@amcharts/amcharts5 5.2.49 → 5.3.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 (887) hide show
  1. package/.internal/charts/flow/Chord.js +151 -199
  2. package/.internal/charts/flow/Chord.js.map +1 -1
  3. package/.internal/charts/flow/ChordDirected.js +46 -66
  4. package/.internal/charts/flow/ChordDirected.js.map +1 -1
  5. package/.internal/charts/flow/ChordLink.js +32 -42
  6. package/.internal/charts/flow/ChordLink.js.map +1 -1
  7. package/.internal/charts/flow/ChordLinkDirected.js +17 -29
  8. package/.internal/charts/flow/ChordLinkDirected.js.map +1 -1
  9. package/.internal/charts/flow/ChordNodes.js +70 -86
  10. package/.internal/charts/flow/ChordNodes.js.map +1 -1
  11. package/.internal/charts/flow/ChordNonRibbon.js +63 -91
  12. package/.internal/charts/flow/ChordNonRibbon.js.map +1 -1
  13. package/.internal/charts/flow/Flow.js +289 -356
  14. package/.internal/charts/flow/Flow.js.map +1 -1
  15. package/.internal/charts/flow/FlowDefaultTheme.js +187 -199
  16. package/.internal/charts/flow/FlowDefaultTheme.js.map +1 -1
  17. package/.internal/charts/flow/FlowLink.js +34 -49
  18. package/.internal/charts/flow/FlowLink.js.map +1 -1
  19. package/.internal/charts/flow/FlowNode.js +17 -22
  20. package/.internal/charts/flow/FlowNode.js.map +1 -1
  21. package/.internal/charts/flow/FlowNodes.js +141 -202
  22. package/.internal/charts/flow/FlowNodes.js.map +1 -1
  23. package/.internal/charts/flow/Sankey.js +165 -203
  24. package/.internal/charts/flow/Sankey.js.map +1 -1
  25. package/.internal/charts/flow/SankeyLink.js +207 -229
  26. package/.internal/charts/flow/SankeyLink.js.map +1 -1
  27. package/.internal/charts/flow/SankeyNodes.js +70 -90
  28. package/.internal/charts/flow/SankeyNodes.js.map +1 -1
  29. package/.internal/charts/funnel/FunnelSeries.js +353 -447
  30. package/.internal/charts/funnel/FunnelSeries.js.map +1 -1
  31. package/.internal/charts/funnel/FunnelSlice.js +96 -117
  32. package/.internal/charts/funnel/FunnelSlice.js.map +1 -1
  33. package/.internal/charts/funnel/PictorialStackedSeries.js +59 -79
  34. package/.internal/charts/funnel/PictorialStackedSeries.js.map +1 -1
  35. package/.internal/charts/funnel/PyramidSeries.js +106 -122
  36. package/.internal/charts/funnel/PyramidSeries.js.map +1 -1
  37. package/.internal/charts/funnel/SlicedChart.js +17 -29
  38. package/.internal/charts/funnel/SlicedChart.js.map +1 -1
  39. package/.internal/charts/hierarchy/BreadcrumbBar.js +69 -96
  40. package/.internal/charts/hierarchy/BreadcrumbBar.js.map +1 -1
  41. package/.internal/charts/hierarchy/ForceDirected.js +255 -370
  42. package/.internal/charts/hierarchy/ForceDirected.js.map +1 -1
  43. package/.internal/charts/hierarchy/Hierarchy.js +476 -640
  44. package/.internal/charts/hierarchy/Hierarchy.js.map +1 -1
  45. package/.internal/charts/hierarchy/HierarchyDefaultTheme.js +337 -349
  46. package/.internal/charts/hierarchy/HierarchyDefaultTheme.js.map +1 -1
  47. package/.internal/charts/hierarchy/HierarchyLink.js +43 -61
  48. package/.internal/charts/hierarchy/HierarchyLink.js.map +1 -1
  49. package/.internal/charts/hierarchy/HierarchyNode.js +57 -74
  50. package/.internal/charts/hierarchy/HierarchyNode.js.map +1 -1
  51. package/.internal/charts/hierarchy/LinkedHierarchy.js +229 -323
  52. package/.internal/charts/hierarchy/LinkedHierarchy.js.map +1 -1
  53. package/.internal/charts/hierarchy/LinkedHierarchyNode.js +48 -80
  54. package/.internal/charts/hierarchy/LinkedHierarchyNode.js.map +1 -1
  55. package/.internal/charts/hierarchy/Pack.js +105 -147
  56. package/.internal/charts/hierarchy/Pack.js.map +1 -1
  57. package/.internal/charts/hierarchy/Partition.js +183 -230
  58. package/.internal/charts/hierarchy/Partition.js.map +1 -1
  59. package/.internal/charts/hierarchy/Sunburst.js +259 -323
  60. package/.internal/charts/hierarchy/Sunburst.js.map +1 -1
  61. package/.internal/charts/hierarchy/Tree.js +49 -69
  62. package/.internal/charts/hierarchy/Tree.js.map +1 -1
  63. package/.internal/charts/hierarchy/Treemap.js +168 -209
  64. package/.internal/charts/hierarchy/Treemap.js.map +1 -1
  65. package/.internal/charts/map/GraticuleSeries.js +49 -70
  66. package/.internal/charts/map/GraticuleSeries.js.map +1 -1
  67. package/.internal/charts/map/MapChart.js +587 -751
  68. package/.internal/charts/map/MapChart.js.map +1 -1
  69. package/.internal/charts/map/MapChartDefaultTheme.js +98 -110
  70. package/.internal/charts/map/MapChartDefaultTheme.js.map +1 -1
  71. package/.internal/charts/map/MapLine.js +165 -196
  72. package/.internal/charts/map/MapLine.js.map +1 -1
  73. package/.internal/charts/map/MapLineSeries.js +130 -197
  74. package/.internal/charts/map/MapLineSeries.js.map +1 -1
  75. package/.internal/charts/map/MapPointSeries.d.ts +7 -2
  76. package/.internal/charts/map/MapPointSeries.d.ts.map +1 -1
  77. package/.internal/charts/map/MapPointSeries.js +265 -342
  78. package/.internal/charts/map/MapPointSeries.js.map +1 -1
  79. package/.internal/charts/map/MapPolygon.js +86 -122
  80. package/.internal/charts/map/MapPolygon.js.map +1 -1
  81. package/.internal/charts/map/MapPolygonSeries.d.ts +6 -1
  82. package/.internal/charts/map/MapPolygonSeries.d.ts.map +1 -1
  83. package/.internal/charts/map/MapPolygonSeries.js +110 -170
  84. package/.internal/charts/map/MapPolygonSeries.js.map +1 -1
  85. package/.internal/charts/map/MapSeries.d.ts +9 -3
  86. package/.internal/charts/map/MapSeries.d.ts.map +1 -1
  87. package/.internal/charts/map/MapSeries.js +212 -303
  88. package/.internal/charts/map/MapSeries.js.map +1 -1
  89. package/.internal/charts/map/MapUtils.js +19 -19
  90. package/.internal/charts/map/MapUtils.js.map +1 -1
  91. package/.internal/charts/map/ZoomControl.js +52 -67
  92. package/.internal/charts/map/ZoomControl.js.map +1 -1
  93. package/.internal/charts/percent/PercentChart.js +23 -40
  94. package/.internal/charts/percent/PercentChart.js.map +1 -1
  95. package/.internal/charts/percent/PercentDefaultTheme.js +196 -208
  96. package/.internal/charts/percent/PercentDefaultTheme.js.map +1 -1
  97. package/.internal/charts/percent/PercentSeries.js +378 -549
  98. package/.internal/charts/percent/PercentSeries.js.map +1 -1
  99. package/.internal/charts/pie/PieChart.js +85 -110
  100. package/.internal/charts/pie/PieChart.js.map +1 -1
  101. package/.internal/charts/pie/PieSeries.js +175 -232
  102. package/.internal/charts/pie/PieSeries.js.map +1 -1
  103. package/.internal/charts/radar/AxisRendererCircular.js +219 -307
  104. package/.internal/charts/radar/AxisRendererCircular.js.map +1 -1
  105. package/.internal/charts/radar/AxisRendererRadial.js +188 -276
  106. package/.internal/charts/radar/AxisRendererRadial.js.map +1 -1
  107. package/.internal/charts/radar/ClockHand.js +89 -104
  108. package/.internal/charts/radar/ClockHand.js.map +1 -1
  109. package/.internal/charts/radar/RadarChart.js +142 -201
  110. package/.internal/charts/radar/RadarChart.js.map +1 -1
  111. package/.internal/charts/radar/RadarColumnSeries.js +118 -170
  112. package/.internal/charts/radar/RadarColumnSeries.js.map +1 -1
  113. package/.internal/charts/radar/RadarCursor.js +147 -220
  114. package/.internal/charts/radar/RadarCursor.js.map +1 -1
  115. package/.internal/charts/radar/RadarDefaultTheme.js +85 -97
  116. package/.internal/charts/radar/RadarDefaultTheme.js.map +1 -1
  117. package/.internal/charts/radar/RadarLineSeries.js +71 -113
  118. package/.internal/charts/radar/RadarLineSeries.js.map +1 -1
  119. package/.internal/charts/radar/SmoothedRadarLineSeries.js +33 -55
  120. package/.internal/charts/radar/SmoothedRadarLineSeries.js.map +1 -1
  121. package/.internal/charts/stock/PanelControls.js +49 -60
  122. package/.internal/charts/stock/PanelControls.js.map +1 -1
  123. package/.internal/charts/stock/SettingsModal.js +321 -393
  124. package/.internal/charts/stock/SettingsModal.js.map +1 -1
  125. package/.internal/charts/stock/StockChart.d.ts.map +1 -1
  126. package/.internal/charts/stock/StockChart.js +466 -568
  127. package/.internal/charts/stock/StockChart.js.map +1 -1
  128. package/.internal/charts/stock/StockChartDefaultTheme.d.ts.map +1 -1
  129. package/.internal/charts/stock/StockChartDefaultTheme.js +1162 -1162
  130. package/.internal/charts/stock/StockChartDefaultTheme.js.map +1 -1
  131. package/.internal/charts/stock/StockLegend.js +65 -91
  132. package/.internal/charts/stock/StockLegend.js.map +1 -1
  133. package/.internal/charts/stock/StockPanel.js +87 -119
  134. package/.internal/charts/stock/StockPanel.js.map +1 -1
  135. package/.internal/charts/stock/drawing/AverageSeries.d.ts.map +1 -1
  136. package/.internal/charts/stock/drawing/AverageSeries.js +48 -60
  137. package/.internal/charts/stock/drawing/AverageSeries.js.map +1 -1
  138. package/.internal/charts/stock/drawing/CalloutSeries.d.ts +7 -2
  139. package/.internal/charts/stock/drawing/CalloutSeries.d.ts.map +1 -1
  140. package/.internal/charts/stock/drawing/CalloutSeries.js +90 -95
  141. package/.internal/charts/stock/drawing/CalloutSeries.js.map +1 -1
  142. package/.internal/charts/stock/drawing/DoodleSeries.d.ts.map +1 -1
  143. package/.internal/charts/stock/drawing/DoodleSeries.js +82 -122
  144. package/.internal/charts/stock/drawing/DoodleSeries.js.map +1 -1
  145. package/.internal/charts/stock/drawing/DrawingSeries.d.ts +5 -3
  146. package/.internal/charts/stock/drawing/DrawingSeries.d.ts.map +1 -1
  147. package/.internal/charts/stock/drawing/DrawingSeries.js +519 -712
  148. package/.internal/charts/stock/drawing/DrawingSeries.js.map +1 -1
  149. package/.internal/charts/stock/drawing/EllipseSeries.d.ts +3 -0
  150. package/.internal/charts/stock/drawing/EllipseSeries.d.ts.map +1 -1
  151. package/.internal/charts/stock/drawing/EllipseSeries.js +258 -307
  152. package/.internal/charts/stock/drawing/EllipseSeries.js.map +1 -1
  153. package/.internal/charts/stock/drawing/FibonacciSeries.d.ts +2 -3
  154. package/.internal/charts/stock/drawing/FibonacciSeries.d.ts.map +1 -1
  155. package/.internal/charts/stock/drawing/FibonacciSeries.js +189 -250
  156. package/.internal/charts/stock/drawing/FibonacciSeries.js.map +1 -1
  157. package/.internal/charts/stock/drawing/FibonacciTimezoneSeries.d.ts.map +1 -1
  158. package/.internal/charts/stock/drawing/FibonacciTimezoneSeries.js +108 -103
  159. package/.internal/charts/stock/drawing/FibonacciTimezoneSeries.js.map +1 -1
  160. package/.internal/charts/stock/drawing/HorizontalLineSeries.d.ts +4 -2
  161. package/.internal/charts/stock/drawing/HorizontalLineSeries.d.ts.map +1 -1
  162. package/.internal/charts/stock/drawing/HorizontalLineSeries.js +64 -84
  163. package/.internal/charts/stock/drawing/HorizontalLineSeries.js.map +1 -1
  164. package/.internal/charts/stock/drawing/HorizontalRaySeries.d.ts +2 -1
  165. package/.internal/charts/stock/drawing/HorizontalRaySeries.d.ts.map +1 -1
  166. package/.internal/charts/stock/drawing/HorizontalRaySeries.js +57 -92
  167. package/.internal/charts/stock/drawing/HorizontalRaySeries.js.map +1 -1
  168. package/.internal/charts/stock/drawing/IconSeries.d.ts +2 -4
  169. package/.internal/charts/stock/drawing/IconSeries.d.ts.map +1 -1
  170. package/.internal/charts/stock/drawing/IconSeries.js +112 -112
  171. package/.internal/charts/stock/drawing/IconSeries.js.map +1 -1
  172. package/.internal/charts/stock/drawing/LabelSeries.d.ts +5 -2
  173. package/.internal/charts/stock/drawing/LabelSeries.d.ts.map +1 -1
  174. package/.internal/charts/stock/drawing/LabelSeries.js +151 -172
  175. package/.internal/charts/stock/drawing/LabelSeries.js.map +1 -1
  176. package/.internal/charts/stock/drawing/PolylineSeries.d.ts +1 -0
  177. package/.internal/charts/stock/drawing/PolylineSeries.d.ts.map +1 -1
  178. package/.internal/charts/stock/drawing/PolylineSeries.js +101 -122
  179. package/.internal/charts/stock/drawing/PolylineSeries.js.map +1 -1
  180. package/.internal/charts/stock/drawing/QuadrantLineSeries.d.ts.map +1 -1
  181. package/.internal/charts/stock/drawing/QuadrantLineSeries.js +115 -149
  182. package/.internal/charts/stock/drawing/QuadrantLineSeries.js.map +1 -1
  183. package/.internal/charts/stock/drawing/RectangleSeries.d.ts.map +1 -1
  184. package/.internal/charts/stock/drawing/RectangleSeries.js +117 -155
  185. package/.internal/charts/stock/drawing/RectangleSeries.js.map +1 -1
  186. package/.internal/charts/stock/drawing/RegressionSeries.d.ts.map +1 -1
  187. package/.internal/charts/stock/drawing/RegressionSeries.js +64 -82
  188. package/.internal/charts/stock/drawing/RegressionSeries.js.map +1 -1
  189. package/.internal/charts/stock/drawing/SimpleLineSeries.d.ts +6 -2
  190. package/.internal/charts/stock/drawing/SimpleLineSeries.d.ts.map +1 -1
  191. package/.internal/charts/stock/drawing/SimpleLineSeries.js +233 -303
  192. package/.internal/charts/stock/drawing/SimpleLineSeries.js.map +1 -1
  193. package/.internal/charts/stock/drawing/TrendLineSeries.d.ts.map +1 -1
  194. package/.internal/charts/stock/drawing/TrendLineSeries.js +40 -57
  195. package/.internal/charts/stock/drawing/TrendLineSeries.js.map +1 -1
  196. package/.internal/charts/stock/drawing/VerticalLineSeries.d.ts +3 -1
  197. package/.internal/charts/stock/drawing/VerticalLineSeries.d.ts.map +1 -1
  198. package/.internal/charts/stock/drawing/VerticalLineSeries.js +63 -79
  199. package/.internal/charts/stock/drawing/VerticalLineSeries.js.map +1 -1
  200. package/.internal/charts/stock/indicators/AccumulationDistribution.js +68 -88
  201. package/.internal/charts/stock/indicators/AccumulationDistribution.js.map +1 -1
  202. package/.internal/charts/stock/indicators/AccumulativeSwingIndex.js +107 -127
  203. package/.internal/charts/stock/indicators/AccumulativeSwingIndex.js.map +1 -1
  204. package/.internal/charts/stock/indicators/Aroon.js +85 -110
  205. package/.internal/charts/stock/indicators/Aroon.js.map +1 -1
  206. package/.internal/charts/stock/indicators/AwesomeOscillator.js +68 -88
  207. package/.internal/charts/stock/indicators/AwesomeOscillator.js.map +1 -1
  208. package/.internal/charts/stock/indicators/BollingerBands.js +109 -135
  209. package/.internal/charts/stock/indicators/BollingerBands.js.map +1 -1
  210. package/.internal/charts/stock/indicators/ChaikinMoneyFlow.js +77 -97
  211. package/.internal/charts/stock/indicators/ChaikinMoneyFlow.js.map +1 -1
  212. package/.internal/charts/stock/indicators/ChaikinOscillator.js +75 -95
  213. package/.internal/charts/stock/indicators/ChaikinOscillator.js.map +1 -1
  214. package/.internal/charts/stock/indicators/ChartIndicator.js +86 -102
  215. package/.internal/charts/stock/indicators/ChartIndicator.js.map +1 -1
  216. package/.internal/charts/stock/indicators/CommodityChannelIndex.js +136 -161
  217. package/.internal/charts/stock/indicators/CommodityChannelIndex.js.map +1 -1
  218. package/.internal/charts/stock/indicators/DisparityIndex.js +69 -89
  219. package/.internal/charts/stock/indicators/DisparityIndex.js.map +1 -1
  220. package/.internal/charts/stock/indicators/Indicator.d.ts +1 -2
  221. package/.internal/charts/stock/indicators/Indicator.d.ts.map +1 -1
  222. package/.internal/charts/stock/indicators/Indicator.js +286 -383
  223. package/.internal/charts/stock/indicators/Indicator.js.map +1 -1
  224. package/.internal/charts/stock/indicators/MACD.js +129 -159
  225. package/.internal/charts/stock/indicators/MACD.js.map +1 -1
  226. package/.internal/charts/stock/indicators/MedianPrice.js +56 -71
  227. package/.internal/charts/stock/indicators/MedianPrice.js.map +1 -1
  228. package/.internal/charts/stock/indicators/MovingAverage.js +95 -115
  229. package/.internal/charts/stock/indicators/MovingAverage.js.map +1 -1
  230. package/.internal/charts/stock/indicators/MovingAverageDeviation.js +93 -118
  231. package/.internal/charts/stock/indicators/MovingAverageDeviation.js.map +1 -1
  232. package/.internal/charts/stock/indicators/MovingAverageEnvelope.js +114 -144
  233. package/.internal/charts/stock/indicators/MovingAverageEnvelope.js.map +1 -1
  234. package/.internal/charts/stock/indicators/OnBalanceVolume.js +65 -85
  235. package/.internal/charts/stock/indicators/OnBalanceVolume.js.map +1 -1
  236. package/.internal/charts/stock/indicators/RelativeStrengthIndex.js +162 -187
  237. package/.internal/charts/stock/indicators/RelativeStrengthIndex.js.map +1 -1
  238. package/.internal/charts/stock/indicators/StandardDeviation.js +56 -72
  239. package/.internal/charts/stock/indicators/StandardDeviation.js.map +1 -1
  240. package/.internal/charts/stock/indicators/StochasticOscillator.js +142 -173
  241. package/.internal/charts/stock/indicators/StochasticOscillator.js.map +1 -1
  242. package/.internal/charts/stock/indicators/Trix.js +90 -120
  243. package/.internal/charts/stock/indicators/Trix.js.map +1 -1
  244. package/.internal/charts/stock/indicators/TypicalPrice.js +56 -71
  245. package/.internal/charts/stock/indicators/TypicalPrice.js.map +1 -1
  246. package/.internal/charts/stock/indicators/VWAP.js +78 -98
  247. package/.internal/charts/stock/indicators/VWAP.js.map +1 -1
  248. package/.internal/charts/stock/indicators/Volume.js +55 -75
  249. package/.internal/charts/stock/indicators/Volume.js.map +1 -1
  250. package/.internal/charts/stock/indicators/WilliamsR.js +138 -163
  251. package/.internal/charts/stock/indicators/WilliamsR.js.map +1 -1
  252. package/.internal/charts/stock/indicators/ZigZag.js +141 -161
  253. package/.internal/charts/stock/indicators/ZigZag.js.map +1 -1
  254. package/.internal/charts/stock/toolbar/ColorControl.js +78 -101
  255. package/.internal/charts/stock/toolbar/ColorControl.js.map +1 -1
  256. package/.internal/charts/stock/toolbar/ComparisonControl.js +16 -28
  257. package/.internal/charts/stock/toolbar/ComparisonControl.js.map +1 -1
  258. package/.internal/charts/stock/toolbar/DateRangeSelector.js +1157 -345
  259. package/.internal/charts/stock/toolbar/DateRangeSelector.js.map +1 -1
  260. package/.internal/charts/stock/toolbar/DrawingControl.d.ts +26 -0
  261. package/.internal/charts/stock/toolbar/DrawingControl.d.ts.map +1 -1
  262. package/.internal/charts/stock/toolbar/DrawingControl.js +754 -709
  263. package/.internal/charts/stock/toolbar/DrawingControl.js.map +1 -1
  264. package/.internal/charts/stock/toolbar/DrawingToolControl.js +80 -119
  265. package/.internal/charts/stock/toolbar/DrawingToolControl.js.map +1 -1
  266. package/.internal/charts/stock/toolbar/Dropdown.js +102 -150
  267. package/.internal/charts/stock/toolbar/Dropdown.js.map +1 -1
  268. package/.internal/charts/stock/toolbar/DropdownColors.js +92 -141
  269. package/.internal/charts/stock/toolbar/DropdownColors.js.map +1 -1
  270. package/.internal/charts/stock/toolbar/DropdownList.js +186 -249
  271. package/.internal/charts/stock/toolbar/DropdownList.js.map +1 -1
  272. package/.internal/charts/stock/toolbar/DropdownListControl.js +117 -150
  273. package/.internal/charts/stock/toolbar/DropdownListControl.js.map +1 -1
  274. package/.internal/charts/stock/toolbar/IconControl.js +81 -120
  275. package/.internal/charts/stock/toolbar/IconControl.js.map +1 -1
  276. package/.internal/charts/stock/toolbar/IndicatorControl.d.ts +23 -1
  277. package/.internal/charts/stock/toolbar/IndicatorControl.d.ts.map +1 -1
  278. package/.internal/charts/stock/toolbar/IndicatorControl.js +352 -297
  279. package/.internal/charts/stock/toolbar/IndicatorControl.js.map +1 -1
  280. package/.internal/charts/stock/toolbar/IntervalControl.js +16 -28
  281. package/.internal/charts/stock/toolbar/IntervalControl.js.map +1 -1
  282. package/.internal/charts/stock/toolbar/PeriodSelector.js +141 -189
  283. package/.internal/charts/stock/toolbar/PeriodSelector.js.map +1 -1
  284. package/.internal/charts/stock/toolbar/ResetControl.js +26 -44
  285. package/.internal/charts/stock/toolbar/ResetControl.js.map +1 -1
  286. package/.internal/charts/stock/toolbar/SeriesTypeControl.js +14 -21
  287. package/.internal/charts/stock/toolbar/SeriesTypeControl.js.map +1 -1
  288. package/.internal/charts/stock/toolbar/SettingsControl.js +97 -140
  289. package/.internal/charts/stock/toolbar/SettingsControl.js.map +1 -1
  290. package/.internal/charts/stock/toolbar/StockControl.js +114 -177
  291. package/.internal/charts/stock/toolbar/StockControl.js.map +1 -1
  292. package/.internal/charts/stock/toolbar/StockIcons.js +67 -81
  293. package/.internal/charts/stock/toolbar/StockIcons.js.map +1 -1
  294. package/.internal/charts/stock/toolbar/StockToolbar.js +63 -94
  295. package/.internal/charts/stock/toolbar/StockToolbar.js.map +1 -1
  296. package/.internal/charts/stock/toolbar/StockToolbarCSS.js +11 -11
  297. package/.internal/charts/stock/toolbar/StockToolbarCSS.js.map +1 -1
  298. package/.internal/charts/venn/Venn.js +276 -373
  299. package/.internal/charts/venn/Venn.js.map +1 -1
  300. package/.internal/charts/venn/VennDefaultTheme.js +18 -30
  301. package/.internal/charts/venn/VennDefaultTheme.js.map +1 -1
  302. package/.internal/charts/wordcloud/WordCloud.js +381 -452
  303. package/.internal/charts/wordcloud/WordCloud.js.map +1 -1
  304. package/.internal/charts/wordcloud/WordCloudDefaultTheme.js +35 -48
  305. package/.internal/charts/wordcloud/WordCloudDefaultTheme.js.map +1 -1
  306. package/.internal/charts/xy/XYChart.js +956 -1136
  307. package/.internal/charts/xy/XYChart.js.map +1 -1
  308. package/.internal/charts/xy/XYChartDefaultTheme.d.ts.map +1 -1
  309. package/.internal/charts/xy/XYChartDefaultTheme.js +597 -604
  310. package/.internal/charts/xy/XYChartDefaultTheme.js.map +1 -1
  311. package/.internal/charts/xy/XYChartScrollbar.js +78 -95
  312. package/.internal/charts/xy/XYChartScrollbar.js.map +1 -1
  313. package/.internal/charts/xy/XYCursor.d.ts.map +1 -1
  314. package/.internal/charts/xy/XYCursor.js +468 -608
  315. package/.internal/charts/xy/XYCursor.js.map +1 -1
  316. package/.internal/charts/xy/axes/Axis.d.ts +0 -2
  317. package/.internal/charts/xy/axes/Axis.d.ts.map +1 -1
  318. package/.internal/charts/xy/axes/Axis.js +509 -726
  319. package/.internal/charts/xy/axes/Axis.js.map +1 -1
  320. package/.internal/charts/xy/axes/AxisBullet.js +30 -40
  321. package/.internal/charts/xy/axes/AxisBullet.js.map +1 -1
  322. package/.internal/charts/xy/axes/AxisLabel.js +17 -22
  323. package/.internal/charts/xy/axes/AxisLabel.js.map +1 -1
  324. package/.internal/charts/xy/axes/AxisLabelRadial.js +17 -22
  325. package/.internal/charts/xy/axes/AxisLabelRadial.js.map +1 -1
  326. package/.internal/charts/xy/axes/AxisRenderer.js +186 -302
  327. package/.internal/charts/xy/axes/AxisRenderer.js.map +1 -1
  328. package/.internal/charts/xy/axes/AxisRendererX.js +308 -400
  329. package/.internal/charts/xy/axes/AxisRendererX.js.map +1 -1
  330. package/.internal/charts/xy/axes/AxisRendererY.js +319 -421
  331. package/.internal/charts/xy/axes/AxisRendererY.js.map +1 -1
  332. package/.internal/charts/xy/axes/AxisTick.js +17 -22
  333. package/.internal/charts/xy/axes/AxisTick.js.map +1 -1
  334. package/.internal/charts/xy/axes/CategoryAxis.js +312 -454
  335. package/.internal/charts/xy/axes/CategoryAxis.js.map +1 -1
  336. package/.internal/charts/xy/axes/CategoryDateAxis.js +136 -167
  337. package/.internal/charts/xy/axes/CategoryDateAxis.js.map +1 -1
  338. package/.internal/charts/xy/axes/DateAxis.js +579 -758
  339. package/.internal/charts/xy/axes/DateAxis.js.map +1 -1
  340. package/.internal/charts/xy/axes/DurationAxis.js +92 -128
  341. package/.internal/charts/xy/axes/DurationAxis.js.map +1 -1
  342. package/.internal/charts/xy/axes/GaplessDateAxis.js +207 -254
  343. package/.internal/charts/xy/axes/GaplessDateAxis.js.map +1 -1
  344. package/.internal/charts/xy/axes/Grid.js +19 -31
  345. package/.internal/charts/xy/axes/Grid.js.map +1 -1
  346. package/.internal/charts/xy/axes/ValueAxis.js +848 -1041
  347. package/.internal/charts/xy/axes/ValueAxis.js.map +1 -1
  348. package/.internal/charts/xy/series/BaseColumnSeries.js +480 -576
  349. package/.internal/charts/xy/series/BaseColumnSeries.js.map +1 -1
  350. package/.internal/charts/xy/series/Candlestick.js +27 -44
  351. package/.internal/charts/xy/series/Candlestick.js.map +1 -1
  352. package/.internal/charts/xy/series/CandlestickSeries.js +114 -140
  353. package/.internal/charts/xy/series/CandlestickSeries.js.map +1 -1
  354. package/.internal/charts/xy/series/ColumnSeries.js +33 -49
  355. package/.internal/charts/xy/series/ColumnSeries.js.map +1 -1
  356. package/.internal/charts/xy/series/LineSeries.js +447 -548
  357. package/.internal/charts/xy/series/LineSeries.js.map +1 -1
  358. package/.internal/charts/xy/series/OHLC.js +36 -48
  359. package/.internal/charts/xy/series/OHLC.js.map +1 -1
  360. package/.internal/charts/xy/series/OHLCSeries.js +32 -48
  361. package/.internal/charts/xy/series/OHLCSeries.js.map +1 -1
  362. package/.internal/charts/xy/series/SmoothedXLineSeries.js +23 -40
  363. package/.internal/charts/xy/series/SmoothedXLineSeries.js.map +1 -1
  364. package/.internal/charts/xy/series/SmoothedXYLineSeries.js +23 -40
  365. package/.internal/charts/xy/series/SmoothedXYLineSeries.js.map +1 -1
  366. package/.internal/charts/xy/series/SmoothedYLineSeries.js +23 -40
  367. package/.internal/charts/xy/series/SmoothedYLineSeries.js.map +1 -1
  368. package/.internal/charts/xy/series/StepLineSeries.js +114 -131
  369. package/.internal/charts/xy/series/StepLineSeries.js.map +1 -1
  370. package/.internal/charts/xy/series/XYSeries.d.ts +1 -1
  371. package/.internal/charts/xy/series/XYSeries.d.ts.map +1 -1
  372. package/.internal/charts/xy/series/XYSeries.js +939 -1222
  373. package/.internal/charts/xy/series/XYSeries.js.map +1 -1
  374. package/.internal/core/Classes.d.ts +11 -7
  375. package/.internal/core/Classes.d.ts.map +1 -1
  376. package/.internal/core/Classes.js.map +1 -1
  377. package/.internal/core/Registry.d.ts.map +1 -1
  378. package/.internal/core/Registry.js +6 -8
  379. package/.internal/core/Registry.js.map +1 -1
  380. package/.internal/core/Root.d.ts +20 -0
  381. package/.internal/core/Root.d.ts.map +1 -1
  382. package/.internal/core/Root.js +1006 -1241
  383. package/.internal/core/Root.js.map +1 -1
  384. package/.internal/core/Theme.js +38 -67
  385. package/.internal/core/Theme.js.map +1 -1
  386. package/.internal/core/render/Bullet.js +34 -49
  387. package/.internal/core/render/Bullet.js.map +1 -1
  388. package/.internal/core/render/Button.js +47 -64
  389. package/.internal/core/render/Button.js.map +1 -1
  390. package/.internal/core/render/Chart.js +20 -25
  391. package/.internal/core/render/Chart.js.map +1 -1
  392. package/.internal/core/render/Circle.js +24 -41
  393. package/.internal/core/render/Circle.js.map +1 -1
  394. package/.internal/core/render/Component.js +239 -384
  395. package/.internal/core/render/Component.js.map +1 -1
  396. package/.internal/core/render/Container.d.ts.map +1 -1
  397. package/.internal/core/render/Container.js +444 -548
  398. package/.internal/core/render/Container.js.map +1 -1
  399. package/.internal/core/render/Ellipse.js +24 -41
  400. package/.internal/core/render/Ellipse.js.map +1 -1
  401. package/.internal/core/render/Graphics.d.ts.map +1 -1
  402. package/.internal/core/render/Graphics.js +197 -215
  403. package/.internal/core/render/Graphics.js.map +1 -1
  404. package/.internal/core/render/GridLayout.js +102 -125
  405. package/.internal/core/render/GridLayout.js.map +1 -1
  406. package/.internal/core/render/HeatLegend.js +129 -154
  407. package/.internal/core/render/HeatLegend.js.map +1 -1
  408. package/.internal/core/render/HorizontalLayout.js +79 -91
  409. package/.internal/core/render/HorizontalLayout.js.map +1 -1
  410. package/.internal/core/render/Label.js +109 -150
  411. package/.internal/core/render/Label.js.map +1 -1
  412. package/.internal/core/render/Layout.js +14 -21
  413. package/.internal/core/render/Layout.js.map +1 -1
  414. package/.internal/core/render/Legend.js +230 -282
  415. package/.internal/core/render/Legend.js.map +1 -1
  416. package/.internal/core/render/Line.js +37 -54
  417. package/.internal/core/render/Line.js.map +1 -1
  418. package/.internal/core/render/MonotoneXTension.js +58 -85
  419. package/.internal/core/render/MonotoneXTension.js.map +1 -1
  420. package/.internal/core/render/MonotoneYTension.js +59 -88
  421. package/.internal/core/render/MonotoneYTension.js.map +1 -1
  422. package/.internal/core/render/Picture.js +92 -113
  423. package/.internal/core/render/Picture.js.map +1 -1
  424. package/.internal/core/render/PointedRectangle.js +94 -111
  425. package/.internal/core/render/PointedRectangle.js.map +1 -1
  426. package/.internal/core/render/RadialLabel.js +119 -158
  427. package/.internal/core/render/RadialLabel.js.map +1 -1
  428. package/.internal/core/render/RadialText.js +47 -62
  429. package/.internal/core/render/RadialText.js.map +1 -1
  430. package/.internal/core/render/Rectangle.js +31 -58
  431. package/.internal/core/render/Rectangle.js.map +1 -1
  432. package/.internal/core/render/RoundedRectangle.js +55 -72
  433. package/.internal/core/render/RoundedRectangle.js.map +1 -1
  434. package/.internal/core/render/Scrollbar.js +292 -349
  435. package/.internal/core/render/Scrollbar.js.map +1 -1
  436. package/.internal/core/render/SerialChart.js +64 -85
  437. package/.internal/core/render/SerialChart.js.map +1 -1
  438. package/.internal/core/render/Series.js +472 -660
  439. package/.internal/core/render/Series.js.map +1 -1
  440. package/.internal/core/render/Slice.js +83 -103
  441. package/.internal/core/render/Slice.js.map +1 -1
  442. package/.internal/core/render/Slider.js +25 -42
  443. package/.internal/core/render/Slider.js.map +1 -1
  444. package/.internal/core/render/Sprite.d.ts +17 -1
  445. package/.internal/core/render/Sprite.d.ts.map +1 -1
  446. package/.internal/core/render/Sprite.js +1307 -1777
  447. package/.internal/core/render/Sprite.js.map +1 -1
  448. package/.internal/core/render/SpriteResizer.js +157 -199
  449. package/.internal/core/render/SpriteResizer.js.map +1 -1
  450. package/.internal/core/render/Star.js +37 -54
  451. package/.internal/core/render/Star.js.map +1 -1
  452. package/.internal/core/render/Text.d.ts.map +1 -1
  453. package/.internal/core/render/Text.js +145 -182
  454. package/.internal/core/render/Text.js.map +1 -1
  455. package/.internal/core/render/Tick.js +14 -21
  456. package/.internal/core/render/Tick.js.map +1 -1
  457. package/.internal/core/render/Tooltip.d.ts +0 -1
  458. package/.internal/core/render/Tooltip.d.ts.map +1 -1
  459. package/.internal/core/render/Tooltip.js +272 -333
  460. package/.internal/core/render/Tooltip.js.map +1 -1
  461. package/.internal/core/render/Triangle.js +38 -65
  462. package/.internal/core/render/Triangle.js.map +1 -1
  463. package/.internal/core/render/VerticalLayout.js +79 -91
  464. package/.internal/core/render/VerticalLayout.js.map +1 -1
  465. package/.internal/core/render/backend/CanvasRenderer.d.ts +2 -2
  466. package/.internal/core/render/backend/CanvasRenderer.d.ts.map +1 -1
  467. package/.internal/core/render/backend/CanvasRenderer.js +2806 -3721
  468. package/.internal/core/render/backend/CanvasRenderer.js.map +1 -1
  469. package/.internal/core/render/backend/Renderer.d.ts +1 -0
  470. package/.internal/core/render/backend/Renderer.d.ts.map +1 -1
  471. package/.internal/core/render/backend/Renderer.js.map +1 -1
  472. package/.internal/core/render/gradients/Gradient.js +45 -72
  473. package/.internal/core/render/gradients/Gradient.js.map +1 -1
  474. package/.internal/core/render/gradients/LinearGradient.js +53 -65
  475. package/.internal/core/render/gradients/LinearGradient.js.map +1 -1
  476. package/.internal/core/render/gradients/RadialGradient.js +69 -81
  477. package/.internal/core/render/gradients/RadialGradient.js.map +1 -1
  478. package/.internal/core/render/patterns/CirclePattern.js +64 -81
  479. package/.internal/core/render/patterns/CirclePattern.js.map +1 -1
  480. package/.internal/core/render/patterns/LinePattern.js +49 -66
  481. package/.internal/core/render/patterns/LinePattern.js.map +1 -1
  482. package/.internal/core/render/patterns/PathPattern.js +72 -89
  483. package/.internal/core/render/patterns/PathPattern.js.map +1 -1
  484. package/.internal/core/render/patterns/Pattern.js +54 -83
  485. package/.internal/core/render/patterns/Pattern.js.map +1 -1
  486. package/.internal/core/render/patterns/PicturePattern.js +69 -90
  487. package/.internal/core/render/patterns/PicturePattern.js.map +1 -1
  488. package/.internal/core/render/patterns/RectanglePattern.js +65 -82
  489. package/.internal/core/render/patterns/RectanglePattern.js.map +1 -1
  490. package/.internal/core/util/Animation.js +102 -151
  491. package/.internal/core/util/Animation.js.map +1 -1
  492. package/.internal/core/util/Array.js +48 -49
  493. package/.internal/core/util/Array.js.map +1 -1
  494. package/.internal/core/util/AsyncPending.js +15 -15
  495. package/.internal/core/util/AsyncPending.js.map +1 -1
  496. package/.internal/core/util/Benchmark.js +37 -55
  497. package/.internal/core/util/Benchmark.js.map +1 -1
  498. package/.internal/core/util/Children.js +42 -67
  499. package/.internal/core/util/Children.js.map +1 -1
  500. package/.internal/core/util/Color.js +110 -206
  501. package/.internal/core/util/Color.js.map +1 -1
  502. package/.internal/core/util/ColorSet.js +73 -110
  503. package/.internal/core/util/ColorSet.js.map +1 -1
  504. package/.internal/core/util/Counter.js +13 -25
  505. package/.internal/core/util/Counter.js.map +1 -1
  506. package/.internal/core/util/Data.js +28 -70
  507. package/.internal/core/util/Data.js.map +1 -1
  508. package/.internal/core/util/DataParser.js +145 -178
  509. package/.internal/core/util/DataParser.js.map +1 -1
  510. package/.internal/core/util/DataProcessor.js +89 -144
  511. package/.internal/core/util/DataProcessor.js.map +1 -1
  512. package/.internal/core/util/DateFormatter.d.ts.map +1 -1
  513. package/.internal/core/util/DateFormatter.js +795 -901
  514. package/.internal/core/util/DateFormatter.js.map +1 -1
  515. package/.internal/core/util/Disposer.js +82 -159
  516. package/.internal/core/util/Disposer.js.map +1 -1
  517. package/.internal/core/util/Draw.js +27 -27
  518. package/.internal/core/util/Draw.js.map +1 -1
  519. package/.internal/core/util/DurationFormatter.js +343 -409
  520. package/.internal/core/util/DurationFormatter.js.map +1 -1
  521. package/.internal/core/util/Ease.js +6 -6
  522. package/.internal/core/util/Entity.d.ts +5 -1
  523. package/.internal/core/util/Entity.d.ts.map +1 -1
  524. package/.internal/core/util/Entity.js +869 -1442
  525. package/.internal/core/util/Entity.js.map +1 -1
  526. package/.internal/core/util/EventDispatcher.js +216 -346
  527. package/.internal/core/util/EventDispatcher.js.map +1 -1
  528. package/.internal/core/util/InterfaceColors.js +14 -21
  529. package/.internal/core/util/InterfaceColors.js.map +1 -1
  530. package/.internal/core/util/Language.js +63 -123
  531. package/.internal/core/util/Language.js.map +1 -1
  532. package/.internal/core/util/List.js +244 -441
  533. package/.internal/core/util/List.js.map +1 -1
  534. package/.internal/core/util/Math.js +35 -35
  535. package/.internal/core/util/Math.js.map +1 -1
  536. package/.internal/core/util/Matrix.js +56 -95
  537. package/.internal/core/util/Matrix.js.map +1 -1
  538. package/.internal/core/util/Modal.js +103 -147
  539. package/.internal/core/util/Modal.js.map +1 -1
  540. package/.internal/core/util/Net.js +19 -19
  541. package/.internal/core/util/Net.js.map +1 -1
  542. package/.internal/core/util/NumberFormatter.js +393 -442
  543. package/.internal/core/util/NumberFormatter.js.map +1 -1
  544. package/.internal/core/util/Object.js +4 -4
  545. package/.internal/core/util/Object.js.map +1 -1
  546. package/.internal/core/util/Order.js +5 -5
  547. package/.internal/core/util/Order.js.map +1 -1
  548. package/.internal/core/util/Percent.js +65 -90
  549. package/.internal/core/util/Percent.js.map +1 -1
  550. package/.internal/core/util/PopulateString.js +28 -28
  551. package/.internal/core/util/PopulateString.js.map +1 -1
  552. package/.internal/core/util/ResizeSensor.js +76 -116
  553. package/.internal/core/util/ResizeSensor.js.map +1 -1
  554. package/.internal/core/util/States.js +116 -188
  555. package/.internal/core/util/States.js.map +1 -1
  556. package/.internal/core/util/Template.js +203 -364
  557. package/.internal/core/util/Template.js.map +1 -1
  558. package/.internal/core/util/TextFormatter.js +148 -184
  559. package/.internal/core/util/TextFormatter.js.map +1 -1
  560. package/.internal/core/util/Throttler.js +18 -26
  561. package/.internal/core/util/Throttler.js.map +1 -1
  562. package/.internal/core/util/Time.d.ts.map +1 -1
  563. package/.internal/core/util/Time.js +61 -63
  564. package/.internal/core/util/Time.js.map +1 -1
  565. package/.internal/core/util/Timezone.js +35 -57
  566. package/.internal/core/util/Timezone.js.map +1 -1
  567. package/.internal/core/util/Type.js +12 -12
  568. package/.internal/core/util/Type.js.map +1 -1
  569. package/.internal/core/util/Utils.d.ts +17 -0
  570. package/.internal/core/util/Utils.d.ts.map +1 -1
  571. package/.internal/core/util/Utils.js +166 -182
  572. package/.internal/core/util/Utils.js.map +1 -1
  573. package/.internal/core/util/Value.js +14 -30
  574. package/.internal/core/util/Value.js.map +1 -1
  575. package/.internal/plugins/exporting/Annotator.js +139 -265
  576. package/.internal/plugins/exporting/Annotator.js.map +1 -1
  577. package/.internal/plugins/exporting/Exporting.js +1216 -1614
  578. package/.internal/plugins/exporting/Exporting.js.map +1 -1
  579. package/.internal/plugins/exporting/ExportingCSS.js +5 -5
  580. package/.internal/plugins/exporting/ExportingCSS.js.map +1 -1
  581. package/.internal/plugins/exporting/ExportingMenu.js +337 -405
  582. package/.internal/plugins/exporting/ExportingMenu.js.map +1 -1
  583. package/.internal/plugins/json/Classes-script.d.ts +16 -0
  584. package/.internal/plugins/json/Classes-script.d.ts.map +1 -1
  585. package/.internal/plugins/json/Classes-script.js +202 -194
  586. package/.internal/plugins/json/Classes-script.js.map +1 -1
  587. package/.internal/plugins/json/Classes.d.ts +16 -0
  588. package/.internal/plugins/json/Classes.d.ts.map +1 -1
  589. package/.internal/plugins/json/Classes.js +202 -194
  590. package/.internal/plugins/json/Classes.js.map +1 -1
  591. package/.internal/plugins/json/Json.d.ts +42 -2
  592. package/.internal/plugins/json/Json.d.ts.map +1 -1
  593. package/.internal/plugins/json/Json.js +391 -278
  594. package/.internal/plugins/json/Json.js.map +1 -1
  595. package/.internal/plugins/json/Serializer.d.ts +62 -0
  596. package/.internal/plugins/json/Serializer.d.ts.map +1 -0
  597. package/.internal/plugins/json/Serializer.js +137 -0
  598. package/.internal/plugins/json/Serializer.js.map +1 -0
  599. package/.internal/plugins/sliceGrouper/SliceGrouper.js +159 -202
  600. package/.internal/plugins/sliceGrouper/SliceGrouper.js.map +1 -1
  601. package/.internal/themes/AnimatedTheme.js +20 -32
  602. package/.internal/themes/AnimatedTheme.js.map +1 -1
  603. package/.internal/themes/DarkTheme.js +28 -40
  604. package/.internal/themes/DarkTheme.js.map +1 -1
  605. package/.internal/themes/DatavizTheme.js +12 -24
  606. package/.internal/themes/DatavizTheme.js.map +1 -1
  607. package/.internal/themes/DefaultTheme.d.ts.map +1 -1
  608. package/.internal/themes/DefaultTheme.js +803 -813
  609. package/.internal/themes/DefaultTheme.js.map +1 -1
  610. package/.internal/themes/FrozenTheme.js +19 -31
  611. package/.internal/themes/FrozenTheme.js.map +1 -1
  612. package/.internal/themes/KellyTheme.js +31 -43
  613. package/.internal/themes/KellyTheme.js.map +1 -1
  614. package/.internal/themes/MaterialTheme.js +28 -40
  615. package/.internal/themes/MaterialTheme.js.map +1 -1
  616. package/.internal/themes/MicrochartTheme.js +67 -79
  617. package/.internal/themes/MicrochartTheme.js.map +1 -1
  618. package/.internal/themes/MoonriseTheme.js +19 -31
  619. package/.internal/themes/MoonriseTheme.js.map +1 -1
  620. package/.internal/themes/ResponsiveTheme.js +613 -790
  621. package/.internal/themes/ResponsiveTheme.js.map +1 -1
  622. package/.internal/themes/SpiritedTheme.js +19 -31
  623. package/.internal/themes/SpiritedTheme.js.map +1 -1
  624. package/CHANGELOG.md +28 -0
  625. package/examples/javascript/flow-chord/package.json +1 -1
  626. package/examples/javascript/flow-chord-directed/package.json +1 -1
  627. package/examples/javascript/flow-chord-non-ribbon/package.json +1 -1
  628. package/examples/javascript/flow-sankey/package.json +1 -1
  629. package/examples/javascript/gauge/package.json +1 -1
  630. package/examples/javascript/gauge-bands/index.js +3 -1
  631. package/examples/javascript/gauge-bands/package.json +1 -1
  632. package/examples/javascript/hierarchy-force-directed/package.json +1 -1
  633. package/examples/javascript/hierarchy-pack/package.json +1 -1
  634. package/examples/javascript/hierarchy-partition/package.json +1 -1
  635. package/examples/javascript/hierarchy-sunburst/package.json +1 -1
  636. package/examples/javascript/hierarchy-tree/package.json +1 -1
  637. package/examples/javascript/hierarchy-treemap/package.json +1 -1
  638. package/examples/javascript/jest/package.json +1 -1
  639. package/examples/javascript/{json → json-pie}/README.md +0 -0
  640. package/examples/javascript/{json → json-pie}/index.css +0 -0
  641. package/examples/javascript/json-pie/index.html +12 -0
  642. package/examples/javascript/json-pie/index.js +77 -0
  643. package/examples/javascript/json-pie/package.json +16 -0
  644. package/examples/javascript/{json → json-pie}/webpack.config.js +0 -0
  645. package/examples/{typescript/json → javascript/json-xy}/README.md +0 -0
  646. package/examples/{typescript/json → javascript/json-xy}/index.css +0 -0
  647. package/examples/{typescript/json → javascript/json-xy}/index.html +1 -1
  648. package/examples/javascript/json-xy/index.js +203 -0
  649. package/examples/javascript/{json → json-xy}/package.json +2 -2
  650. package/examples/javascript/json-xy/webpack.config.js +38 -0
  651. package/examples/javascript/map-animating-along-lines/package.json +1 -1
  652. package/examples/javascript/map-day-and-night/package.json +1 -1
  653. package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
  654. package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
  655. package/examples/javascript/map-with-bubbles/package.json +1 -1
  656. package/examples/javascript/map-zoom-to-country/package.json +1 -1
  657. package/examples/javascript/misc-40-charts/package.json +1 -1
  658. package/examples/javascript/misc-microchart-grid/package.json +1 -1
  659. package/examples/javascript/pie-chart/package.json +1 -1
  660. package/examples/javascript/pie-donut-chart/package.json +1 -1
  661. package/examples/javascript/pie-variable-radius/package.json +1 -1
  662. package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
  663. package/examples/javascript/radar-heat-map/index.js +33 -33
  664. package/examples/javascript/radar-heat-map/package.json +1 -1
  665. package/examples/javascript/radar-line/package.json +1 -1
  666. package/examples/javascript/radar-time-line/package.json +1 -1
  667. package/examples/javascript/sliced-funnel/package.json +1 -1
  668. package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
  669. package/examples/javascript/sliced-pyramid/package.json +1 -1
  670. package/examples/javascript/stock-chart/package.json +1 -1
  671. package/examples/javascript/stock-chart-comparing-stocks/package.json +1 -1
  672. package/examples/javascript/stock-chart-data-granularity/package.json +1 -1
  673. package/examples/javascript/stock-chart-data-grouping/package.json +1 -1
  674. package/examples/javascript/stock-chart-intraday/package.json +1 -1
  675. package/examples/javascript/stock-chart-live/package.json +1 -1
  676. package/examples/javascript/stock-chart-volume-separate-panel/package.json +1 -1
  677. package/examples/javascript/venn-diagram/package.json +1 -1
  678. package/examples/javascript/wordcloud-with-data/package.json +1 -1
  679. package/examples/javascript/wordcloud-with-text/package.json +1 -1
  680. package/examples/javascript/xy-100-percent-stacked-column/package.json +1 -1
  681. package/examples/javascript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  682. package/examples/javascript/xy-bubble/package.json +1 -1
  683. package/examples/javascript/xy-candlestick/package.json +1 -1
  684. package/examples/javascript/xy-clustered-column/package.json +1 -1
  685. package/examples/javascript/xy-column/package.json +1 -1
  686. package/examples/javascript/xy-comparing-series-google-analytics-style/package.json +1 -1
  687. package/examples/javascript/xy-data-grouping/package.json +1 -1
  688. package/examples/javascript/xy-draggable-range/package.json +1 -1
  689. package/examples/javascript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  690. package/examples/javascript/xy-dumbbell plot/package.json +1 -1
  691. package/examples/javascript/xy-evenly-spaced-date-axis/package.json +1 -1
  692. package/examples/javascript/xy-line/package.json +1 -1
  693. package/examples/javascript/xy-line-highlight-on-legend-hover/package.json +1 -1
  694. package/examples/javascript/xy-live-data/package.json +1 -1
  695. package/examples/javascript/xy-multiple-synced-value-axes/package.json +1 -1
  696. package/examples/javascript/xy-ohlc/package.json +1 -1
  697. package/examples/javascript/xy-real-time-data-sorting/package.json +1 -1
  698. package/examples/javascript/xy-smoothed-line/package.json +1 -1
  699. package/examples/javascript/xy-stacked-and-clustered-column/package.json +1 -1
  700. package/examples/javascript/xy-stacked-column/package.json +1 -1
  701. package/examples/javascript/xy-stacked-step/package.json +1 -1
  702. package/examples/javascript/xy-stock/package.json +1 -1
  703. package/examples/javascript/xy-stock-comparing/package.json +1 -1
  704. package/examples/typescript/flow-chord/package.json +1 -1
  705. package/examples/typescript/flow-chord/tsconfig.json +1 -1
  706. package/examples/typescript/flow-chord-directed/package.json +1 -1
  707. package/examples/typescript/flow-chord-directed/tsconfig.json +1 -1
  708. package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
  709. package/examples/typescript/flow-chord-non-ribbon/tsconfig.json +1 -1
  710. package/examples/typescript/flow-sankey/package.json +1 -1
  711. package/examples/typescript/flow-sankey/tsconfig.json +1 -1
  712. package/examples/typescript/gauge/package.json +1 -1
  713. package/examples/typescript/gauge/tsconfig.json +1 -1
  714. package/examples/typescript/gauge-bands/index.ts +3 -1
  715. package/examples/typescript/gauge-bands/package.json +1 -1
  716. package/examples/typescript/gauge-bands/tsconfig.json +1 -1
  717. package/examples/typescript/hierarchy-force-directed/package.json +1 -1
  718. package/examples/typescript/hierarchy-force-directed/tsconfig.json +1 -1
  719. package/examples/typescript/hierarchy-pack/package.json +1 -1
  720. package/examples/typescript/hierarchy-pack/tsconfig.json +1 -1
  721. package/examples/typescript/hierarchy-partition/package.json +1 -1
  722. package/examples/typescript/hierarchy-partition/tsconfig.json +1 -1
  723. package/examples/typescript/hierarchy-sunburst/package.json +1 -1
  724. package/examples/typescript/hierarchy-sunburst/tsconfig.json +1 -1
  725. package/examples/typescript/hierarchy-tree/package.json +1 -1
  726. package/examples/typescript/hierarchy-tree/tsconfig.json +1 -1
  727. package/examples/typescript/hierarchy-treemap/package.json +1 -1
  728. package/examples/typescript/hierarchy-treemap/tsconfig.json +1 -1
  729. package/examples/typescript/jest/package.json +1 -1
  730. package/examples/typescript/jest/tsconfig.json +1 -1
  731. package/examples/typescript/json-pie/README.md +6 -0
  732. package/examples/typescript/json-pie/index.css +11 -0
  733. package/examples/typescript/json-pie/index.html +12 -0
  734. package/examples/typescript/json-pie/index.ts +77 -0
  735. package/examples/typescript/json-pie/package.json +18 -0
  736. package/examples/typescript/{json → json-pie}/tsconfig.json +1 -1
  737. package/examples/typescript/{json → json-pie}/webpack.config.js +0 -0
  738. package/examples/typescript/json-xy/README.md +6 -0
  739. package/examples/typescript/json-xy/index.css +11 -0
  740. package/examples/{javascript/json → typescript/json-xy}/index.html +1 -1
  741. package/examples/typescript/json-xy/index.ts +203 -0
  742. package/examples/typescript/{json → json-xy}/package.json +2 -2
  743. package/examples/typescript/json-xy/tsconfig.json +12 -0
  744. package/examples/typescript/json-xy/webpack.config.js +45 -0
  745. package/examples/typescript/map-animating-along-lines/package.json +1 -1
  746. package/examples/typescript/map-animating-along-lines/tsconfig.json +1 -1
  747. package/examples/typescript/map-day-and-night/package.json +1 -1
  748. package/examples/typescript/map-day-and-night/tsconfig.json +1 -1
  749. package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
  750. package/examples/typescript/map-globe-rotate-to-country/tsconfig.json +1 -1
  751. package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
  752. package/examples/typescript/map-globe-with-projected-circles/tsconfig.json +1 -1
  753. package/examples/typescript/map-with-bubbles/package.json +1 -1
  754. package/examples/typescript/map-with-bubbles/tsconfig.json +1 -1
  755. package/examples/typescript/map-zoom-to-country/package.json +1 -1
  756. package/examples/typescript/map-zoom-to-country/tsconfig.json +1 -1
  757. package/examples/typescript/misc-40-charts/package.json +1 -1
  758. package/examples/typescript/misc-40-charts/tsconfig.json +1 -1
  759. package/examples/typescript/misc-microchart-grid/package.json +1 -1
  760. package/examples/typescript/misc-microchart-grid/tsconfig.json +1 -1
  761. package/examples/typescript/pie-chart/package.json +1 -1
  762. package/examples/typescript/pie-chart/tsconfig.json +1 -1
  763. package/examples/typescript/pie-donut-chart/package.json +1 -1
  764. package/examples/typescript/pie-donut-chart/tsconfig.json +1 -1
  765. package/examples/typescript/pie-variable-radius/package.json +1 -1
  766. package/examples/typescript/pie-variable-radius/tsconfig.json +1 -1
  767. package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
  768. package/examples/typescript/radar-column-iwatch-style/tsconfig.json +1 -1
  769. package/examples/typescript/radar-heat-map/index.ts +33 -33
  770. package/examples/typescript/radar-heat-map/package.json +1 -1
  771. package/examples/typescript/radar-heat-map/tsconfig.json +1 -1
  772. package/examples/typescript/radar-line/package.json +1 -1
  773. package/examples/typescript/radar-line/tsconfig.json +1 -1
  774. package/examples/typescript/radar-time-line/package.json +1 -1
  775. package/examples/typescript/radar-time-line/tsconfig.json +1 -1
  776. package/examples/typescript/sliced-funnel/package.json +1 -1
  777. package/examples/typescript/sliced-funnel/tsconfig.json +1 -1
  778. package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
  779. package/examples/typescript/sliced-pictorial-stacked/tsconfig.json +1 -1
  780. package/examples/typescript/sliced-pyramid/package.json +1 -1
  781. package/examples/typescript/sliced-pyramid/tsconfig.json +1 -1
  782. package/examples/typescript/stock-chart/package.json +1 -1
  783. package/examples/typescript/stock-chart/tsconfig.json +1 -1
  784. package/examples/typescript/stock-chart-comparing-stocks/package.json +1 -1
  785. package/examples/typescript/stock-chart-comparing-stocks/tsconfig.json +1 -1
  786. package/examples/typescript/stock-chart-data-granularity/package.json +1 -1
  787. package/examples/typescript/stock-chart-data-granularity/tsconfig.json +1 -1
  788. package/examples/typescript/stock-chart-data-grouping/package.json +1 -1
  789. package/examples/typescript/stock-chart-data-grouping/tsconfig.json +1 -1
  790. package/examples/typescript/stock-chart-intraday/package.json +1 -1
  791. package/examples/typescript/stock-chart-intraday/tsconfig.json +1 -1
  792. package/examples/typescript/stock-chart-live/package.json +1 -1
  793. package/examples/typescript/stock-chart-live/tsconfig.json +1 -1
  794. package/examples/typescript/stock-chart-volume-separate-panel/package.json +1 -1
  795. package/examples/typescript/stock-chart-volume-separate-panel/tsconfig.json +1 -1
  796. package/examples/typescript/venn-diagram/package.json +1 -1
  797. package/examples/typescript/venn-diagram/tsconfig.json +1 -1
  798. package/examples/typescript/wordcloud-with-data/package.json +1 -1
  799. package/examples/typescript/wordcloud-with-data/tsconfig.json +1 -1
  800. package/examples/typescript/wordcloud-with-text/package.json +1 -1
  801. package/examples/typescript/wordcloud-with-text/tsconfig.json +1 -1
  802. package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
  803. package/examples/typescript/xy-100-percent-stacked-column/tsconfig.json +1 -1
  804. package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  805. package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/tsconfig.json +1 -1
  806. package/examples/typescript/xy-bubble/package.json +1 -1
  807. package/examples/typescript/xy-bubble/tsconfig.json +1 -1
  808. package/examples/typescript/xy-candlestick/package.json +1 -1
  809. package/examples/typescript/xy-candlestick/tsconfig.json +1 -1
  810. package/examples/typescript/xy-clustered-column/package.json +1 -1
  811. package/examples/typescript/xy-clustered-column/tsconfig.json +1 -1
  812. package/examples/typescript/xy-column/package.json +1 -1
  813. package/examples/typescript/xy-column/tsconfig.json +1 -1
  814. package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
  815. package/examples/typescript/xy-comparing-series-google-analytics-style/tsconfig.json +1 -1
  816. package/examples/typescript/xy-data-grouping/package.json +1 -1
  817. package/examples/typescript/xy-data-grouping/tsconfig.json +1 -1
  818. package/examples/typescript/xy-draggable-range/package.json +1 -1
  819. package/examples/typescript/xy-draggable-range/tsconfig.json +1 -1
  820. package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  821. package/examples/typescript/xy-drawing-series-with-mouse-or-touch/tsconfig.json +1 -1
  822. package/examples/typescript/xy-dumbbell plot/package.json +1 -1
  823. package/examples/typescript/xy-dumbbell plot/tsconfig.json +1 -1
  824. package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
  825. package/examples/typescript/xy-evenly-spaced-date-axis/tsconfig.json +1 -1
  826. package/examples/typescript/xy-line/package.json +1 -1
  827. package/examples/typescript/xy-line/tsconfig.json +1 -1
  828. package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
  829. package/examples/typescript/xy-line-highlight-on-legend-hover/tsconfig.json +1 -1
  830. package/examples/typescript/xy-live-data/package.json +1 -1
  831. package/examples/typescript/xy-live-data/tsconfig.json +1 -1
  832. package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
  833. package/examples/typescript/xy-multiple-synced-value-axes/tsconfig.json +1 -1
  834. package/examples/typescript/xy-ohlc/package.json +1 -1
  835. package/examples/typescript/xy-ohlc/tsconfig.json +1 -1
  836. package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
  837. package/examples/typescript/xy-real-time-data-sorting/tsconfig.json +1 -1
  838. package/examples/typescript/xy-smoothed-line/package.json +1 -1
  839. package/examples/typescript/xy-smoothed-line/tsconfig.json +1 -1
  840. package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
  841. package/examples/typescript/xy-stacked-and-clustered-column/tsconfig.json +1 -1
  842. package/examples/typescript/xy-stacked-column/package.json +1 -1
  843. package/examples/typescript/xy-stacked-column/tsconfig.json +1 -1
  844. package/examples/typescript/xy-stacked-step/package.json +1 -1
  845. package/examples/typescript/xy-stacked-step/tsconfig.json +1 -1
  846. package/examples/typescript/xy-stock/package.json +1 -1
  847. package/examples/typescript/xy-stock/tsconfig.json +1 -1
  848. package/examples/typescript/xy-stock-comparing/package.json +1 -1
  849. package/examples/typescript/xy-stock-comparing/tsconfig.json +1 -1
  850. package/locales/ar.js +1 -1
  851. package/locales/bg_BG.js +1 -1
  852. package/locales/bs_BA.js +1 -1
  853. package/locales/ca_ES.js +1 -1
  854. package/locales/cs_CZ.js +1 -1
  855. package/locales/da_DK.js +1 -1
  856. package/locales/el_GR.js +1 -1
  857. package/locales/en.js +1 -1
  858. package/locales/en_CA.js +1 -1
  859. package/locales/en_US.js +1 -1
  860. package/locales/et_EE.js +1 -1
  861. package/locales/fi_FI.js +1 -1
  862. package/locales/fr_FR.js +1 -1
  863. package/locales/he_IL.js +1 -1
  864. package/locales/hi_IN.js +1 -1
  865. package/locales/hr_HR.js +1 -1
  866. package/locales/hu_HU.js +1 -1
  867. package/locales/id_ID.js +1 -1
  868. package/locales/ja_JP.js +1 -1
  869. package/locales/ko_KR.js +1 -1
  870. package/locales/lv_LV.js +1 -1
  871. package/locales/nb_NO.js +1 -1
  872. package/locales/nl_NL.js +1 -1
  873. package/locales/pl_PL.js +1 -1
  874. package/locales/ro_RO.js +1 -1
  875. package/locales/sr_RS.js +1 -1
  876. package/locales/th_TH.js +1 -1
  877. package/locales/tr_TR.js +1 -1
  878. package/locales/vi_VN.js +1 -1
  879. package/locales/zh_Hans.js +1 -1
  880. package/locales/zh_Hant.js +1 -1
  881. package/package.json +1 -1
  882. package/plugins/json.d.ts +1 -0
  883. package/plugins/json.d.ts.map +1 -1
  884. package/plugins/json.js +1 -0
  885. package/plugins/json.js.map +1 -1
  886. package/examples/javascript/json/index.js +0 -206
  887. package/examples/typescript/json/index.ts +0 -206
@@ -1,4 +1,4 @@
1
- import { __awaiter, __extends, __generator } from "tslib";
1
+ import { __awaiter } from "tslib";
2
2
  import { Entity } from "../../core/util/Entity";
3
3
  import { Color } from "../../core/util/Color";
4
4
  import { Root } from "../../core/Root";
@@ -12,7 +12,7 @@ import * as $utils from "../../core/util/Utils";
12
12
  *
13
13
  * @ignore
14
14
  */
15
- var pdfmakePromise;
15
+ let pdfmakePromise;
16
16
  /**
17
17
  * Loads pdfmake dynamic module
18
18
  *
@@ -22,25 +22,18 @@ var pdfmakePromise;
22
22
  * @ignore
23
23
  */
24
24
  function _pdfmake() {
25
- return __awaiter(this, void 0, void 0, function () {
26
- var a, pdfmake, vfs_fonts, global;
27
- return __generator(this, function (_a) {
28
- switch (_a.label) {
29
- case 0: return [4 /*yield*/, Promise.all([
30
- import(/* webpackChunkName: "pdfmake" */ "pdfmake/build/pdfmake.js"),
31
- import(/* webpackChunkName: "pdfmake" */ "./pdfmake/vfs_fonts")
32
- ])];
33
- case 1:
34
- a = _a.sent();
35
- pdfmake = a[0];
36
- vfs_fonts = a[1];
37
- global = window;
38
- global.pdfMake = global.pdfMake || {};
39
- global.pdfMake.vfs = vfs_fonts.default;
40
- pdfmake.vfs = vfs_fonts.default;
41
- return [2 /*return*/, pdfmake];
42
- }
43
- });
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ let a = yield Promise.all([
27
+ import(/* webpackChunkName: "pdfmake" */ "pdfmake/build/pdfmake.js"),
28
+ import(/* webpackChunkName: "pdfmake" */ "./pdfmake/vfs_fonts")
29
+ ]);
30
+ let pdfmake = a[0];
31
+ let vfs_fonts = a[1];
32
+ const global = window;
33
+ global.pdfMake = global.pdfMake || {};
34
+ global.pdfMake.vfs = vfs_fonts.default;
35
+ pdfmake.vfs = vfs_fonts.default;
36
+ return pdfmake;
44
37
  });
45
38
  }
46
39
  /**
@@ -48,134 +41,87 @@ function _pdfmake() {
48
41
  *
49
42
  * @see {@link https://www.amcharts.com/docs/v5/concepts/exporting/} for more info
50
43
  */
51
- var Exporting = /** @class */ (function (_super) {
52
- __extends(Exporting, _super);
53
- function Exporting() {
54
- return _super !== null && _super.apply(this, arguments) || this;
55
- }
44
+ export class Exporting extends Entity {
56
45
  //public extraImages: Array<Root | IExportingImageSource> = [];
57
46
  //public dataSources: any[] = [];
58
- Object.defineProperty(Exporting.prototype, "_afterNew", {
59
- enumerable: false,
60
- configurable: true,
61
- writable: true,
62
- value: function () {
63
- _super.prototype._afterNew.call(this);
64
- this._setRawDefault("filePrefix", "chart");
65
- this._setRawDefault("charset", "utf-8");
66
- this._setRawDefault("numericFields", []);
67
- this._setRawDefault("dateFields", []);
68
- this._setRawDefault("durationFields", []);
69
- this._setRawDefault("extraImages", []);
70
- this._setRawDefault("pngOptions", { quality: 1, maintainPixelRatio: false });
71
- this._setRawDefault("jpgOptions", { quality: 0.8, maintainPixelRatio: false });
72
- this._setRawDefault("printOptions", { quality: 1, maintainPixelRatio: false, delay: 500, printMethod: "iframe", imageFormat: "png" });
73
- this._setRawDefault("jsonOptions", { indent: 2, renameFields: true });
74
- this._setRawDefault("csvOptions", { separator: ",", addColumnNames: true, emptyAs: "", addBOM: true });
75
- this._setRawDefault("htmlOptions", { emptyAs: "-", addColumnNames: true });
76
- this._setRawDefault("xlsxOptions", { emptyAs: "", addColumnNames: true });
77
- this._setRawDefault("pdfOptions", { fontSize: 14, imageFormat: "png", align: "left", addURL: true });
78
- this._setRawDefault("pdfdataOptions", { emptyAs: "", addColumnNames: true });
79
- this._root.addDisposer(this);
80
- }
81
- });
82
- Object.defineProperty(Exporting.prototype, "_beforeChanged", {
83
- enumerable: false,
84
- configurable: true,
85
- writable: true,
86
- value: function () {
87
- _super.prototype._beforeChanged.call(this);
88
- if (this.isDirty("menu")) {
89
- var menu = this.get("menu");
90
- if (menu) {
91
- menu.set("exporting", this);
92
- this._disposers.push(menu);
93
- }
47
+ _afterNew() {
48
+ super._afterNew();
49
+ this._setRawDefault("filePrefix", "chart");
50
+ this._setRawDefault("charset", "utf-8");
51
+ this._setRawDefault("numericFields", []);
52
+ this._setRawDefault("dateFields", []);
53
+ this._setRawDefault("durationFields", []);
54
+ this._setRawDefault("extraImages", []);
55
+ this._setRawDefault("pngOptions", { quality: 1, maintainPixelRatio: false });
56
+ this._setRawDefault("jpgOptions", { quality: 0.8, maintainPixelRatio: false });
57
+ this._setRawDefault("printOptions", { quality: 1, maintainPixelRatio: false, delay: 500, printMethod: "iframe", imageFormat: "png" });
58
+ this._setRawDefault("jsonOptions", { indent: 2, renameFields: true });
59
+ this._setRawDefault("csvOptions", { separator: ",", addColumnNames: true, emptyAs: "", addBOM: true });
60
+ this._setRawDefault("htmlOptions", { emptyAs: "-", addColumnNames: true });
61
+ this._setRawDefault("xlsxOptions", { emptyAs: "", addColumnNames: true });
62
+ this._setRawDefault("pdfOptions", { fontSize: 14, imageFormat: "png", align: "left", addURL: true });
63
+ this._setRawDefault("pdfdataOptions", { emptyAs: "", addColumnNames: true });
64
+ this._root.addDisposer(this);
65
+ }
66
+ _beforeChanged() {
67
+ super._beforeChanged();
68
+ if (this.isDirty("menu")) {
69
+ const menu = this.get("menu");
70
+ if (menu) {
71
+ menu.set("exporting", this);
72
+ this._disposers.push(menu);
94
73
  }
95
74
  }
96
- });
97
- Object.defineProperty(Exporting.prototype, "_getFormatOptions", {
98
- enumerable: false,
99
- configurable: true,
100
- writable: true,
101
- value: function (format, options) {
102
- var newOptions = $object.copy(this.get(format + "Options", {}));
103
- if (options) {
104
- $object.each(options, function (key, value) {
105
- newOptions[key] = value;
106
- });
107
- }
108
- return newOptions;
75
+ }
76
+ _getFormatOptions(format, options) {
77
+ const newOptions = $object.copy(this.get(format + "Options", {}));
78
+ if (options) {
79
+ $object.each(options, (key, value) => {
80
+ newOptions[key] = value;
81
+ });
109
82
  }
110
- });
83
+ return newOptions;
84
+ }
111
85
  /**
112
86
  * Triggers a download of the chart/data in specific format.
113
87
  *
114
88
  * @param format Format
115
89
  * @param customOptions Format options
116
90
  */
117
- Object.defineProperty(Exporting.prototype, "download", {
118
- enumerable: false,
119
- configurable: true,
120
- writable: true,
121
- value: function (format, customOptions) {
122
- return __awaiter(this, void 0, void 0, function () {
123
- var ext, fileName, options, uri;
124
- return __generator(this, function (_a) {
125
- switch (_a.label) {
126
- case 0:
127
- ext = format == "pdfdata" ? "pdf" : format;
128
- fileName = this.get("filePrefix", "chart") + "." + ext;
129
- options = this._getFormatOptions(format, customOptions);
130
- this.events.dispatch("downloadstarted", {
131
- type: "downloadstarted",
132
- format: format,
133
- options: options,
134
- fileName: fileName,
135
- target: this
136
- });
137
- return [4 /*yield*/, this.export(format, options)];
138
- case 1:
139
- uri = _a.sent();
140
- this.streamFile(uri, fileName, (options && options.addBOM));
141
- return [2 /*return*/];
142
- }
143
- });
91
+ download(format, customOptions) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ const ext = format == "pdfdata" ? "pdf" : format;
94
+ const fileName = this.get("filePrefix", "chart") + "." + ext;
95
+ const options = this._getFormatOptions(format, customOptions);
96
+ this.events.dispatch("downloadstarted", {
97
+ type: "downloadstarted",
98
+ format: format,
99
+ options: options,
100
+ fileName: fileName,
101
+ target: this
144
102
  });
145
- }
146
- });
103
+ const uri = yield this.export(format, options);
104
+ this.streamFile(uri, fileName, (options && options.addBOM));
105
+ });
106
+ }
147
107
  /**
148
108
  * Triggers print of the chart.
149
109
  *
150
110
  * @param customOptions Print options
151
111
  */
152
- Object.defineProperty(Exporting.prototype, "print", {
153
- enumerable: false,
154
- configurable: true,
155
- writable: true,
156
- value: function (customOptions) {
157
- return __awaiter(this, void 0, void 0, function () {
158
- var options, uri;
159
- return __generator(this, function (_a) {
160
- switch (_a.label) {
161
- case 0:
162
- options = this._getFormatOptions("print", customOptions);
163
- this.events.dispatch("printstarted", {
164
- type: "printstarted",
165
- format: "print",
166
- options: options,
167
- target: this
168
- });
169
- return [4 /*yield*/, this.export(options.imageFormat || "png", options)];
170
- case 1:
171
- uri = _a.sent();
172
- this.initiatePrint(uri, options, this.get("title"));
173
- return [2 /*return*/];
174
- }
175
- });
112
+ print(customOptions) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ const options = this._getFormatOptions("print", customOptions);
115
+ this.events.dispatch("printstarted", {
116
+ type: "printstarted",
117
+ format: "print",
118
+ options: options,
119
+ target: this
176
120
  });
177
- }
178
- });
121
+ const uri = yield this.export(options.imageFormat || "png", options);
122
+ this.initiatePrint(uri, options, this.get("title"));
123
+ });
124
+ }
179
125
  /**
180
126
  * Returns data uri of the chart/data in specific format.
181
127
  *
@@ -183,59 +129,51 @@ var Exporting = /** @class */ (function (_super) {
183
129
  * @param customOptions Format options
184
130
  * @return Promise
185
131
  */
186
- Object.defineProperty(Exporting.prototype, "export", {
187
- enumerable: false,
188
- configurable: true,
189
- writable: true,
190
- value: function (format, customOptions) {
191
- return __awaiter(this, void 0, void 0, function () {
192
- var options, promise;
193
- return __generator(this, function (_a) {
194
- options = this._getFormatOptions(format, customOptions);
195
- this.events.dispatch("exportstarted", {
196
- type: "exportstarted",
197
- format: format,
198
- options: options,
199
- target: this
200
- });
201
- // Force any randering to complete before proceeding
202
- this._root._runTickerNow();
203
- promise = "";
204
- switch (format) {
205
- case "png":
206
- case "jpg":
207
- promise = this.exportImage(format, options);
208
- break;
209
- case "json":
210
- promise = this.exportJSON(options);
211
- break;
212
- case "csv":
213
- promise = this.exportCSV(options);
214
- break;
215
- case "html":
216
- promise = this.exportHTML(options);
217
- break;
218
- case "xlsx":
219
- promise = this.exportXLSX(options);
220
- break;
221
- case "pdf":
222
- promise = this.exportPDF(options);
223
- break;
224
- case "pdfdata":
225
- promise = this.exportPDFData(options);
226
- break;
227
- }
228
- this.events.dispatch("exportfinished", {
229
- type: "exportfinished",
230
- format: format,
231
- options: options,
232
- target: this
233
- });
234
- return [2 /*return*/, promise];
235
- });
132
+ export(format, customOptions) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ const options = this._getFormatOptions(format, customOptions);
135
+ this.events.dispatch("exportstarted", {
136
+ type: "exportstarted",
137
+ format: format,
138
+ options: options,
139
+ target: this
236
140
  });
237
- }
238
- });
141
+ // Force any randering to complete before proceeding
142
+ this._root._runTickerNow();
143
+ let promise = "";
144
+ switch (format) {
145
+ case "png":
146
+ case "jpg":
147
+ promise = this.exportImage(format, options);
148
+ break;
149
+ case "json":
150
+ promise = this.exportJSON(options);
151
+ break;
152
+ case "csv":
153
+ promise = this.exportCSV(options);
154
+ break;
155
+ case "html":
156
+ promise = this.exportHTML(options);
157
+ break;
158
+ case "xlsx":
159
+ promise = this.exportXLSX(options);
160
+ break;
161
+ case "pdf":
162
+ promise = this.exportPDF(options);
163
+ break;
164
+ case "pdfdata":
165
+ promise = this.exportPDFData(options);
166
+ break;
167
+ }
168
+ this.events.dispatch("exportfinished", {
169
+ type: "exportfinished",
170
+ format: format,
171
+ options: options,
172
+ target: this
173
+ });
174
+ return promise;
175
+ });
176
+ }
239
177
  /**
240
178
  * ==========================================================================
241
179
  * Images
@@ -248,165 +186,133 @@ var Exporting = /** @class */ (function (_super) {
248
186
  * @param customOptions Format options
249
187
  * @return Promise
250
188
  */
251
- Object.defineProperty(Exporting.prototype, "exportImage", {
252
- enumerable: false,
253
- configurable: true,
254
- writable: true,
255
- value: function (format, customOptions) {
256
- return __awaiter(this, void 0, void 0, function () {
257
- var options, canvas, data;
258
- return __generator(this, function (_a) {
259
- switch (_a.label) {
260
- case 0:
261
- options = this._getFormatOptions(format, customOptions);
262
- return [4 /*yield*/, this.getCanvas(options)];
263
- case 1:
264
- canvas = _a.sent();
265
- data = canvas.toDataURL(this.getContentType(format), options.quality || 1);
266
- this.disposeCanvas(canvas);
267
- return [2 /*return*/, data];
268
- }
269
- });
270
- });
271
- }
272
- });
189
+ exportImage(format, customOptions) {
190
+ return __awaiter(this, void 0, void 0, function* () {
191
+ const options = this._getFormatOptions(format, customOptions);
192
+ const canvas = yield this.getCanvas(options);
193
+ const data = canvas.toDataURL(this.getContentType(format), options.quality || 1);
194
+ this.disposeCanvas(canvas);
195
+ return data;
196
+ });
197
+ }
273
198
  /**
274
199
  * Returns canvas data.
275
200
  *
276
201
  * @param customOptions Image options
277
202
  * @return Promise
278
203
  */
279
- Object.defineProperty(Exporting.prototype, "exportCanvas", {
280
- enumerable: false,
281
- configurable: true,
282
- writable: true,
283
- value: function (customOptions) {
284
- return __awaiter(this, void 0, void 0, function () {
285
- var options, canvas, data;
286
- return __generator(this, function (_a) {
287
- switch (_a.label) {
288
- case 0:
289
- options = this._getFormatOptions("canvas", customOptions);
290
- return [4 /*yield*/, this.getCanvas(options)];
291
- case 1:
292
- canvas = _a.sent();
293
- data = canvas.toDataURL(this.getContentType("canvas"), options.quality || 1);
294
- this.disposeCanvas(canvas);
295
- return [2 /*return*/, data];
296
- }
297
- });
298
- });
299
- }
300
- });
204
+ exportCanvas(customOptions) {
205
+ return __awaiter(this, void 0, void 0, function* () {
206
+ const options = this._getFormatOptions("canvas", customOptions);
207
+ const canvas = yield this.getCanvas(options);
208
+ const data = canvas.toDataURL(this.getContentType("canvas"), options.quality || 1);
209
+ this.disposeCanvas(canvas);
210
+ return data;
211
+ });
212
+ }
301
213
  /**
302
214
  * Returns a `<canvas>` element with snapshot of the chart.
303
215
  *
304
216
  * @param options Image options
305
217
  * @return Promise
306
218
  */
307
- Object.defineProperty(Exporting.prototype, "getCanvas", {
308
- enumerable: false,
309
- configurable: true,
310
- writable: true,
311
- value: function (options) {
312
- return __awaiter(this, void 0, void 0, function () {
313
- var mainCanvas, extraImages, middleLeft, middleTop, middleWidth, middleHeight, extraRight, extraBottom, extras, newCanvas, ctx, background, backgroundOpacity, left, top, right, bottom;
314
- return __generator(this, function (_a) {
315
- mainCanvas = this._root._renderer.getCanvas(this._root._rootContainer._display, options);
316
- extraImages = this.get("extraImages", []);
317
- middleLeft = 0;
318
- middleTop = 0;
319
- middleWidth = mainCanvas.width;
320
- middleHeight = mainCanvas.height;
321
- extraRight = 0;
322
- extraBottom = 0;
323
- extras = [];
324
- $array.each(extraImages, function (extraRoot) {
325
- // Get that extra
326
- var extra;
327
- if (extraRoot instanceof Root) {
328
- extra = {
329
- source: extraRoot,
330
- position: "bottom"
331
- };
332
- }
333
- else {
334
- extra = extraRoot;
335
- }
336
- // Set defaults
337
- extra.position = extra.position || "bottom";
338
- extra.marginTop = extra.marginTop || 0;
339
- extra.marginRight = extra.marginRight || 0;
340
- extra.marginBottom = extra.marginBottom || 0;
341
- extra.marginLeft = extra.marginLeft || 0;
342
- var extraCanvas = extra.source._renderer.getCanvas(extra.source._rootContainer._display, options);
343
- var extraWidth = extraCanvas.width + extra.marginLeft + extra.marginRight;
344
- var extraHeight = extraCanvas.height + extra.marginTop + extra.marginBottom;
345
- if (extra.position == "top") {
346
- middleWidth = extra.crop ? middleHeight : Math.max(middleWidth, extraWidth);
347
- middleTop += extraHeight;
348
- }
349
- else if (extra.position == "right") {
350
- middleHeight = extra.crop ? middleHeight : Math.max(middleHeight, extraHeight);
351
- extraRight += extraWidth;
352
- }
353
- else if (extra.position == "left") {
354
- middleHeight = extra.crop ? middleHeight : Math.max(middleHeight, extraHeight);
355
- middleLeft += extraWidth;
356
- }
357
- else if (extra.position === "bottom") {
358
- middleWidth = extra.crop ? middleHeight : Math.max(middleWidth, extraWidth);
359
- extraBottom += extraHeight;
360
- }
361
- extras.push({
362
- canvas: extraCanvas,
363
- position: extra.position,
364
- left: extra.marginLeft,
365
- top: extra.marginTop,
366
- width: extraWidth,
367
- height: extraHeight
368
- });
369
- });
370
- newCanvas = this.getDisposableCanvas();
371
- newCanvas.width = middleLeft + middleWidth + extraRight;
372
- newCanvas.height = middleTop + middleHeight + extraBottom;
373
- ctx = newCanvas.getContext("2d");
374
- background = this.get("backgroundColor", this.findBackgroundColor(this._root.dom));
375
- backgroundOpacity = this.get("backgroundOpacity", 1);
376
- if (background) {
377
- ctx.fillStyle = background.toCSS(backgroundOpacity);
378
- ctx.fillRect(0, 0, newCanvas.width, newCanvas.height);
379
- }
380
- left = middleLeft;
381
- top = middleTop;
382
- right = left + middleWidth;
383
- bottom = top + middleHeight;
384
- // Radiates outwards from center
385
- $array.each(extras, function (extra) {
386
- if (extra.position == "top") {
387
- top -= extra.height;
388
- ctx.drawImage(extra.canvas, middleLeft + extra.left, top + extra.top);
389
- }
390
- else if (extra.position == "right") {
391
- ctx.drawImage(extra.canvas, right + extra.left, middleTop + extra.top);
392
- right += extra.width;
393
- }
394
- else if (extra.position == "left") {
395
- left -= extra.width;
396
- ctx.drawImage(extra.canvas, left + extra.left, middleTop + extra.top);
397
- }
398
- else if (extra.position === "bottom") {
399
- ctx.drawImage(extra.canvas, middleLeft + extra.left, bottom + extra.top);
400
- bottom += extra.height;
401
- }
402
- //this.disposeCanvas(extra.canvas);
403
- });
404
- ctx.drawImage(mainCanvas, middleLeft, middleTop);
405
- return [2 /*return*/, newCanvas];
219
+ getCanvas(options) {
220
+ return __awaiter(this, void 0, void 0, function* () {
221
+ const mainCanvas = this._root._renderer.getCanvas(this._root._rootContainer._display, options);
222
+ const extraImages = this.get("extraImages", []);
223
+ // Add other canvases
224
+ let middleLeft = 0;
225
+ let middleTop = 0;
226
+ let middleWidth = mainCanvas.width;
227
+ let middleHeight = mainCanvas.height;
228
+ let extraRight = 0;
229
+ let extraBottom = 0;
230
+ const extras = [];
231
+ $array.each(extraImages, (extraRoot) => {
232
+ // Get that extra
233
+ let extra;
234
+ if (extraRoot instanceof Root) {
235
+ extra = {
236
+ source: extraRoot,
237
+ position: "bottom"
238
+ };
239
+ }
240
+ else {
241
+ extra = extraRoot;
242
+ }
243
+ // Set defaults
244
+ extra.position = extra.position || "bottom";
245
+ extra.marginTop = extra.marginTop || 0;
246
+ extra.marginRight = extra.marginRight || 0;
247
+ extra.marginBottom = extra.marginBottom || 0;
248
+ extra.marginLeft = extra.marginLeft || 0;
249
+ const extraCanvas = extra.source._renderer.getCanvas(extra.source._rootContainer._display, options);
250
+ const extraWidth = extraCanvas.width + extra.marginLeft + extra.marginRight;
251
+ const extraHeight = extraCanvas.height + extra.marginTop + extra.marginBottom;
252
+ if (extra.position == "top") {
253
+ middleWidth = extra.crop ? middleHeight : Math.max(middleWidth, extraWidth);
254
+ middleTop += extraHeight;
255
+ }
256
+ else if (extra.position == "right") {
257
+ middleHeight = extra.crop ? middleHeight : Math.max(middleHeight, extraHeight);
258
+ extraRight += extraWidth;
259
+ }
260
+ else if (extra.position == "left") {
261
+ middleHeight = extra.crop ? middleHeight : Math.max(middleHeight, extraHeight);
262
+ middleLeft += extraWidth;
263
+ }
264
+ else if (extra.position === "bottom") {
265
+ middleWidth = extra.crop ? middleHeight : Math.max(middleWidth, extraWidth);
266
+ extraBottom += extraHeight;
267
+ }
268
+ extras.push({
269
+ canvas: extraCanvas,
270
+ position: extra.position,
271
+ left: extra.marginLeft,
272
+ top: extra.marginTop,
273
+ width: extraWidth,
274
+ height: extraHeight
406
275
  });
407
276
  });
408
- }
409
- });
277
+ const newCanvas = this.getDisposableCanvas();
278
+ newCanvas.width = middleLeft + middleWidth + extraRight;
279
+ newCanvas.height = middleTop + middleHeight + extraBottom;
280
+ const ctx = newCanvas.getContext("2d");
281
+ // Get background
282
+ const background = this.get("backgroundColor", this.findBackgroundColor(this._root.dom));
283
+ const backgroundOpacity = this.get("backgroundOpacity", 1);
284
+ if (background) {
285
+ ctx.fillStyle = background.toCSS(backgroundOpacity);
286
+ ctx.fillRect(0, 0, newCanvas.width, newCanvas.height);
287
+ }
288
+ let left = middleLeft;
289
+ let top = middleTop;
290
+ let right = left + middleWidth;
291
+ let bottom = top + middleHeight;
292
+ // Radiates outwards from center
293
+ $array.each(extras, (extra) => {
294
+ if (extra.position == "top") {
295
+ top -= extra.height;
296
+ ctx.drawImage(extra.canvas, middleLeft + extra.left, top + extra.top);
297
+ }
298
+ else if (extra.position == "right") {
299
+ ctx.drawImage(extra.canvas, right + extra.left, middleTop + extra.top);
300
+ right += extra.width;
301
+ }
302
+ else if (extra.position == "left") {
303
+ left -= extra.width;
304
+ ctx.drawImage(extra.canvas, left + extra.left, middleTop + extra.top);
305
+ }
306
+ else if (extra.position === "bottom") {
307
+ ctx.drawImage(extra.canvas, middleLeft + extra.left, bottom + extra.top);
308
+ bottom += extra.height;
309
+ }
310
+ //this.disposeCanvas(extra.canvas);
311
+ });
312
+ ctx.drawImage(mainCanvas, middleLeft, middleTop);
313
+ return newCanvas;
314
+ });
315
+ }
410
316
  /**
411
317
  * ==========================================================================
412
318
  * JSON
@@ -418,53 +324,30 @@ var Exporting = /** @class */ (function (_super) {
418
324
  * @param customOptions Format options
419
325
  * @return Promise
420
326
  */
421
- Object.defineProperty(Exporting.prototype, "exportJSON", {
422
- enumerable: false,
423
- configurable: true,
424
- writable: true,
425
- value: function (customOptions) {
426
- return __awaiter(this, void 0, void 0, function () {
427
- var _a, _b;
428
- return __generator(this, function (_c) {
429
- switch (_c.label) {
430
- case 0:
431
- _a = "data:" + this.getContentType("json") + ";" + this.get("charset", "utf-8") + ",";
432
- _b = encodeURIComponent;
433
- return [4 /*yield*/, this.getJSON(customOptions)];
434
- case 1: return [2 /*return*/, _a + _b.apply(void 0, [_c.sent()])];
435
- }
436
- });
437
- });
438
- }
439
- });
327
+ exportJSON(customOptions) {
328
+ return __awaiter(this, void 0, void 0, function* () {
329
+ return "data:" + this.getContentType("json") + ";" + this.get("charset", "utf-8") + "," + encodeURIComponent(yield this.getJSON(customOptions));
330
+ });
331
+ }
440
332
  /**
441
333
  * Returns data in JSON format.
442
334
  *
443
335
  * @param customOptions Format options
444
336
  * @return Promise
445
337
  */
446
- Object.defineProperty(Exporting.prototype, "getJSON", {
447
- enumerable: false,
448
- configurable: true,
449
- writable: true,
450
- value: function (customOptions) {
451
- return __awaiter(this, void 0, void 0, function () {
452
- var options;
453
- var _this = this;
454
- return __generator(this, function (_a) {
455
- options = this._getFormatOptions("json", customOptions);
456
- return [2 /*return*/, JSON.stringify(this.getData("json", customOptions, options.renameFields), function (_key, value) {
457
- if ($type.isObject(value)) {
458
- $object.each(value, function (field, item) {
459
- value[field] = _this.convertToSpecialFormat(field, item, options);
460
- });
461
- }
462
- return value;
463
- }, options.indent)];
464
- });
465
- });
466
- }
467
- });
338
+ getJSON(customOptions) {
339
+ return __awaiter(this, void 0, void 0, function* () {
340
+ const options = this._getFormatOptions("json", customOptions);
341
+ return JSON.stringify(this.getData("json", customOptions, options.renameFields), (_key, value) => {
342
+ if ($type.isObject(value)) {
343
+ $object.each(value, (field, item) => {
344
+ value[field] = this.convertToSpecialFormat(field, item, options);
345
+ });
346
+ }
347
+ return value;
348
+ }, options.indent);
349
+ });
350
+ }
468
351
  /**
469
352
  * ==========================================================================
470
353
  * CSV
@@ -476,148 +359,122 @@ var Exporting = /** @class */ (function (_super) {
476
359
  * @param customOptions Format options
477
360
  * @return Promise
478
361
  */
479
- Object.defineProperty(Exporting.prototype, "exportCSV", {
480
- enumerable: false,
481
- configurable: true,
482
- writable: true,
483
- value: function (customOptions) {
484
- return __awaiter(this, void 0, void 0, function () {
485
- var _a, _b;
486
- return __generator(this, function (_c) {
487
- switch (_c.label) {
488
- case 0:
489
- _a = "data:" + this.getContentType("csv") + ";" + this.get("charset", "utf-8") + ",";
490
- _b = encodeURIComponent;
491
- return [4 /*yield*/, this.getCSV(customOptions)];
492
- case 1: return [2 /*return*/, _a + _b.apply(void 0, [_c.sent()])];
493
- }
494
- });
495
- });
496
- }
497
- });
362
+ exportCSV(customOptions) {
363
+ return __awaiter(this, void 0, void 0, function* () {
364
+ return "data:" + this.getContentType("csv") + ";" + this.get("charset", "utf-8") + "," + encodeURIComponent(yield this.getCSV(customOptions));
365
+ });
366
+ }
498
367
  /**
499
368
  * Returns a CSV with export data.
500
369
  *
501
370
  * @param customOptions CSV options
502
371
  * @return Promise
503
372
  */
504
- Object.defineProperty(Exporting.prototype, "getCSV", {
505
- enumerable: false,
506
- configurable: true,
507
- writable: true,
508
- value: function (customOptions) {
509
- return __awaiter(this, void 0, void 0, function () {
510
- var options, csv, br, data, dataFields, dataFieldsOrder_1, len, i, row;
511
- var _this = this;
512
- return __generator(this, function (_a) {
513
- options = this._getFormatOptions("csv", customOptions);
514
- csv = "";
515
- br = "";
516
- data = this.getData("csv", options);
517
- dataFields = this.getDataFields(data);
518
- // Vertical or horizontal (default) layout
519
- if (options.pivot) {
520
- dataFieldsOrder_1 = this.get("dataFieldsOrder", []);
521
- $object.eachOrdered(dataFields, function (key, val) {
522
- var dataRow = [];
523
- if (options.addColumnNames) {
524
- dataRow.push(val);
525
- }
526
- for (var len = data.length, i = 0; i < len; i++) {
527
- var dataValue = data[i][key];
528
- dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));
529
- }
530
- csv += br + _this.getCSVRow(dataRow, options, undefined, true);
531
- br = "\n";
532
- }, function (a, b) {
533
- var ai = dataFieldsOrder_1.indexOf(a);
534
- var bi = dataFieldsOrder_1.indexOf(b);
535
- if (ai > bi) {
536
- return -1;
537
- }
538
- else if (ai < bi) {
539
- return 1;
540
- }
541
- return 0;
542
- });
373
+ getCSV(customOptions) {
374
+ return __awaiter(this, void 0, void 0, function* () {
375
+ const options = this._getFormatOptions("csv", customOptions);
376
+ // Init output
377
+ let csv = "";
378
+ // Add rows
379
+ let br = "";
380
+ const data = this.getData("csv", options);
381
+ // Data fields
382
+ const dataFields = this.getDataFields(data);
383
+ // Vertical or horizontal (default) layout
384
+ if (options.pivot) {
385
+ // Data fields order
386
+ const dataFieldsOrder = this.get("dataFieldsOrder", []);
387
+ $object.eachOrdered(dataFields, (key, val) => {
388
+ let dataRow = [];
389
+ if (options.addColumnNames) {
390
+ dataRow.push(val);
543
391
  }
544
- else {
545
- for (len = data.length, i = 0; i < len; i++) {
546
- row = this.getCSVRow(data[i], options, dataFields);
547
- if (options.reverse) {
548
- csv = row + br + csv;
549
- }
550
- else {
551
- csv += br + row;
552
- }
553
- br = "\n";
554
- }
555
- // Add column names?
556
- if (options.addColumnNames) {
557
- csv = this.getCSVRow(dataFields, options, undefined, true) + br + csv;
558
- }
392
+ for (let len = data.length, i = 0; i < len; i++) {
393
+ let dataValue = data[i][key];
394
+ dataRow.push(this.convertToSpecialFormat(key, dataValue, options, true));
559
395
  }
560
- return [2 /*return*/, csv];
561
- });
562
- });
563
- }
564
- });
565
- /**
566
- * @ignore
567
- */
568
- Object.defineProperty(Exporting.prototype, "getCSVRow", {
569
- enumerable: false,
570
- configurable: true,
571
- writable: true,
572
- value: function (row, options, dataFields, asIs) {
573
- var _this = this;
574
- if (asIs === void 0) { asIs = false; }
575
- // Init
576
- var separator = options.separator || ",";
577
- var items = [];
578
- // Data fields
579
- if (!dataFields) {
580
- dataFields = {};
581
- $object.each(row, function (key, value) {
582
- dataFields[key] = value;
396
+ csv += br + this.getCSVRow(dataRow, options, undefined, true);
397
+ br = "\n";
398
+ }, (a, b) => {
399
+ let ai = dataFieldsOrder.indexOf(a);
400
+ let bi = dataFieldsOrder.indexOf(b);
401
+ if (ai > bi) {
402
+ return -1;
403
+ }
404
+ else if (ai < bi) {
405
+ return 1;
406
+ }
407
+ return 0;
583
408
  });
584
409
  }
585
- // Data fields order
586
- var dataFieldsOrder = this.get("dataFieldsOrder", []);
587
- // Process each row item
588
- $object.eachOrdered(dataFields, function (key, _name) {
589
- // Get value
590
- var value = _this.convertEmptyValue(key, row[key], options);
591
- // Check if we need to skip
592
- // This is no longer required because we are iterating via dataFields anyway
593
- /*if (this.dataFields != null && this.dataFields[key] == null) {
594
- return;
595
- }*/
596
- // Convert dates
597
- var item = asIs ? value : _this.convertToSpecialFormat(key, value, options);
598
- // Cast and escape doublequotes
599
- item = "" + item;
600
- item = item.replace(/"/g, '""');
601
- // Enclose into double quotes
602
- if (options.forceQuotes || (item.search(new RegExp("\"|\n|" + separator, "g")) >= 0)) {
603
- item = "\"" + item + "\"";
604
- }
605
- // Add to item
606
- items.push(item);
607
- }, function (a, b) {
608
- var ai = dataFieldsOrder.indexOf(a);
609
- var bi = dataFieldsOrder.indexOf(b);
610
- if (ai > bi) {
611
- return 1;
410
+ else {
411
+ for (let len = data.length, i = 0; i < len; i++) {
412
+ let row = this.getCSVRow(data[i], options, dataFields);
413
+ if (options.reverse) {
414
+ csv = row + br + csv;
415
+ }
416
+ else {
417
+ csv += br + row;
418
+ }
419
+ br = "\n";
612
420
  }
613
- else if (ai < bi) {
614
- return -1;
421
+ // Add column names?
422
+ if (options.addColumnNames) {
423
+ csv = this.getCSVRow(dataFields, options, undefined, true) + br + csv;
615
424
  }
616
- return 0;
425
+ }
426
+ return csv;
427
+ });
428
+ }
429
+ /**
430
+ * @ignore
431
+ */
432
+ getCSVRow(row, options, dataFields, asIs = false) {
433
+ // Init
434
+ let separator = options.separator || ",";
435
+ let items = [];
436
+ // Data fields
437
+ if (!dataFields) {
438
+ dataFields = {};
439
+ $object.each(row, (key, value) => {
440
+ dataFields[key] = value;
617
441
  });
618
- return items.join(separator);
619
442
  }
620
- });
443
+ // Data fields order
444
+ const dataFieldsOrder = this.get("dataFieldsOrder", []);
445
+ // Process each row item
446
+ $object.eachOrdered(dataFields, (key, _name) => {
447
+ // Get value
448
+ let value = this.convertEmptyValue(key, row[key], options);
449
+ // Check if we need to skip
450
+ // This is no longer required because we are iterating via dataFields anyway
451
+ /*if (this.dataFields != null && this.dataFields[key] == null) {
452
+ return;
453
+ }*/
454
+ // Convert dates
455
+ let item = asIs ? value : this.convertToSpecialFormat(key, value, options);
456
+ // Cast and escape doublequotes
457
+ item = "" + item;
458
+ item = item.replace(/"/g, '""');
459
+ // Enclose into double quotes
460
+ if (options.forceQuotes || (item.search(new RegExp("\"|\n|" + separator, "g")) >= 0)) {
461
+ item = "\"" + item + "\"";
462
+ }
463
+ // Add to item
464
+ items.push(item);
465
+ }, (a, b) => {
466
+ let ai = dataFieldsOrder.indexOf(a);
467
+ let bi = dataFieldsOrder.indexOf(b);
468
+ if (ai > bi) {
469
+ return 1;
470
+ }
471
+ else if (ai < bi) {
472
+ return -1;
473
+ }
474
+ return 0;
475
+ });
476
+ return items.join(separator);
477
+ }
621
478
  /**
622
479
  * ==========================================================================
623
480
  * HTML
@@ -629,155 +486,127 @@ var Exporting = /** @class */ (function (_super) {
629
486
  * @param customOptions Format options
630
487
  * @return Promise
631
488
  */
632
- Object.defineProperty(Exporting.prototype, "exportHTML", {
633
- enumerable: false,
634
- configurable: true,
635
- writable: true,
636
- value: function (customOptions) {
637
- return __awaiter(this, void 0, void 0, function () {
638
- var _a, _b;
639
- return __generator(this, function (_c) {
640
- switch (_c.label) {
641
- case 0:
642
- _a = "data:" + this.getContentType("html") + ";" + this.get("charset", "utf-8") + ",";
643
- _b = encodeURIComponent;
644
- return [4 /*yield*/, this.getHTML(customOptions)];
645
- case 1: return [2 /*return*/, _a + _b.apply(void 0, [_c.sent()])];
646
- }
647
- });
648
- });
649
- }
650
- });
489
+ exportHTML(customOptions) {
490
+ return __awaiter(this, void 0, void 0, function* () {
491
+ return "data:" + this.getContentType("html") + ";" + this.get("charset", "utf-8") + "," + encodeURIComponent(yield this.getHTML(customOptions));
492
+ });
493
+ }
651
494
  /**
652
495
  * Returns an HTML with a table with export data.
653
496
  *
654
497
  * @param customOptions HTML options
655
498
  * @return Promise
656
499
  */
657
- Object.defineProperty(Exporting.prototype, "getHTML", {
658
- enumerable: false,
659
- configurable: true,
660
- writable: true,
661
- value: function (customOptions) {
662
- return __awaiter(this, void 0, void 0, function () {
663
- var options, html, data, dataFields, dataFieldsOrder_2, len, i;
664
- var _this = this;
665
- return __generator(this, function (_a) {
666
- options = this._getFormatOptions("html", customOptions);
667
- html = "<table>";
668
- if (options.tableClass) {
669
- html = "<table class=\"" + options.tableClass + "\">";
500
+ getHTML(customOptions) {
501
+ return __awaiter(this, void 0, void 0, function* () {
502
+ const options = this._getFormatOptions("html", customOptions);
503
+ // Init output
504
+ let html = "<table>";
505
+ if (options.tableClass) {
506
+ html = "<table class=\"" + options.tableClass + "\">";
507
+ }
508
+ // Get data
509
+ const data = this.getData("html", options);
510
+ const dataFields = this.getDataFields(data);
511
+ // Vertical or horizontal (default) layout
512
+ if (options.pivot) {
513
+ // Data fields order
514
+ const dataFieldsOrder = this.get("dataFieldsOrder", []);
515
+ html += "\n<tbody>";
516
+ $object.eachOrdered(dataFields, (key, val) => {
517
+ let dataRow = [];
518
+ if (options.addColumnNames) {
519
+ dataRow.push(val);
670
520
  }
671
- data = this.getData("html", options);
672
- dataFields = this.getDataFields(data);
673
- // Vertical or horizontal (default) layout
674
- if (options.pivot) {
675
- dataFieldsOrder_2 = this.get("dataFieldsOrder", []);
676
- html += "\n<tbody>";
677
- $object.eachOrdered(dataFields, function (key, val) {
678
- var dataRow = [];
679
- if (options.addColumnNames) {
680
- dataRow.push(val);
681
- }
682
- for (var len = data.length, i = 0; i < len; i++) {
683
- var dataValue = data[i][key];
684
- dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));
685
- }
686
- html += "\n" + _this.getHTMLRow(dataRow, options, undefined, true);
687
- }, function (a, b) {
688
- var ai = dataFieldsOrder_2.indexOf(a);
689
- var bi = dataFieldsOrder_2.indexOf(b);
690
- if (ai > bi) {
691
- return -1;
692
- }
693
- else if (ai < bi) {
694
- return 1;
695
- }
696
- return 0;
697
- });
698
- html += "\n</tbody>";
521
+ for (let len = data.length, i = 0; i < len; i++) {
522
+ let dataValue = data[i][key];
523
+ dataRow.push(this.convertToSpecialFormat(key, dataValue, options, true));
699
524
  }
700
- else {
701
- // Add column names?
702
- if (options.addColumnNames) {
703
- html += "\n<thead>\n" + this.getHTMLRow(dataFields, options, undefined, true, true) + "\n</thead>";
704
- }
705
- html += "\n<tbody>";
706
- for (len = data.length, i = 0; i < len; i++) {
707
- html += "\n" + this.getHTMLRow(data[i], options, dataFields);
708
- }
709
- html += "\n</tbody>";
525
+ html += "\n" + this.getHTMLRow(dataRow, options, undefined, true);
526
+ }, (a, b) => {
527
+ let ai = dataFieldsOrder.indexOf(a);
528
+ let bi = dataFieldsOrder.indexOf(b);
529
+ if (ai > bi) {
530
+ return -1;
710
531
  }
711
- html += "\n</table>";
712
- return [2 /*return*/, html];
532
+ else if (ai < bi) {
533
+ return 1;
534
+ }
535
+ return 0;
713
536
  });
714
- });
715
- }
716
- });
717
- /**
718
- * @ignore
719
- */
720
- Object.defineProperty(Exporting.prototype, "getHTMLRow", {
721
- enumerable: false,
722
- configurable: true,
723
- writable: true,
724
- value: function (row, options, dataFields, asIs, headerRow) {
725
- var _this = this;
726
- if (asIs === void 0) { asIs = false; }
727
- if (headerRow === void 0) { headerRow = false; }
728
- // Init output
729
- var html = "\t<tr>";
730
- if (options.rowClass) {
731
- html = "\t<tr class=\"" + options.rowClass + "\">";
732
- }
733
- // Data fields
734
- if (!dataFields) {
735
- dataFields = row;
537
+ html += "\n</tbody>";
736
538
  }
737
- // Data fields order
738
- var dataFieldsOrder = this.get("dataFieldsOrder", []);
739
- // th or dh?
740
- var tag = headerRow ? "th" : "td";
741
- // Process each row item
742
- var first = true;
743
- $object.eachOrdered(dataFields, function (key, _name) {
744
- // Get value
745
- var value = _this.convertEmptyValue(key, row[key], options);
746
- // Convert dates
747
- var item = asIs ? value : _this.convertToSpecialFormat(key, value, options);
748
- // Escape HTML entities
749
- item = "" + item;
750
- item = item.replace(/[\u00A0-\u9999<>\&]/gim, function (i) {
751
- return "&#" + i.charCodeAt(0) + ";";
752
- });
753
- // Which tag to use
754
- var useTag = tag;
755
- if (options.pivot && first) {
756
- useTag = "th";
757
- }
758
- // Add cell
759
- if (options.cellClass) {
760
- html += "\n\t\t<" + useTag + " class=\"" + options.cellClass + "\">" + item + "</" + useTag + ">";
761
- }
762
- else {
763
- html += "\n\t\t<" + useTag + ">" + item + "</" + useTag + ">";
764
- }
765
- first = false;
766
- }, function (a, b) {
767
- var ai = dataFieldsOrder.indexOf(a);
768
- var bi = dataFieldsOrder.indexOf(b);
769
- if (ai > bi) {
770
- return 1;
539
+ else {
540
+ // Add column names?
541
+ if (options.addColumnNames) {
542
+ html += "\n<thead>\n" + this.getHTMLRow(dataFields, options, undefined, true, true) + "\n</thead>";
771
543
  }
772
- else if (ai < bi) {
773
- return -1;
544
+ html += "\n<tbody>";
545
+ for (let len = data.length, i = 0; i < len; i++) {
546
+ html += "\n" + this.getHTMLRow(data[i], options, dataFields);
774
547
  }
775
- return 0;
776
- });
777
- html += "\n\t</tr>";
548
+ html += "\n</tbody>";
549
+ }
550
+ html += "\n</table>";
778
551
  return html;
552
+ });
553
+ }
554
+ /**
555
+ * @ignore
556
+ */
557
+ getHTMLRow(row, options, dataFields, asIs = false, headerRow = false) {
558
+ // Init output
559
+ let html = "\t<tr>";
560
+ if (options.rowClass) {
561
+ html = "\t<tr class=\"" + options.rowClass + "\">";
779
562
  }
780
- });
563
+ // Data fields
564
+ if (!dataFields) {
565
+ dataFields = row;
566
+ }
567
+ // Data fields order
568
+ const dataFieldsOrder = this.get("dataFieldsOrder", []);
569
+ // th or dh?
570
+ const tag = headerRow ? "th" : "td";
571
+ // Process each row item
572
+ let first = true;
573
+ $object.eachOrdered(dataFields, (key, _name) => {
574
+ // Get value
575
+ let value = this.convertEmptyValue(key, row[key], options);
576
+ // Convert dates
577
+ let item = asIs ? value : this.convertToSpecialFormat(key, value, options);
578
+ // Escape HTML entities
579
+ item = "" + item;
580
+ item = item.replace(/[\u00A0-\u9999<>\&]/gim, function (i) {
581
+ return "&#" + i.charCodeAt(0) + ";";
582
+ });
583
+ // Which tag to use
584
+ let useTag = tag;
585
+ if (options.pivot && first) {
586
+ useTag = "th";
587
+ }
588
+ // Add cell
589
+ if (options.cellClass) {
590
+ html += "\n\t\t<" + useTag + " class=\"" + options.cellClass + "\">" + item + "</" + useTag + ">";
591
+ }
592
+ else {
593
+ html += "\n\t\t<" + useTag + ">" + item + "</" + useTag + ">";
594
+ }
595
+ first = false;
596
+ }, (a, b) => {
597
+ let ai = dataFieldsOrder.indexOf(a);
598
+ let bi = dataFieldsOrder.indexOf(b);
599
+ if (ai > bi) {
600
+ return 1;
601
+ }
602
+ else if (ai < bi) {
603
+ return -1;
604
+ }
605
+ return 0;
606
+ });
607
+ html += "\n\t</tr>";
608
+ return html;
609
+ }
781
610
  /**
782
611
  * ==========================================================================
783
612
  * XLSX
@@ -789,191 +618,143 @@ var Exporting = /** @class */ (function (_super) {
789
618
  * @param customOptions Format options
790
619
  * @return Promise
791
620
  */
792
- Object.defineProperty(Exporting.prototype, "exportXLSX", {
793
- enumerable: false,
794
- configurable: true,
795
- writable: true,
796
- value: function (customOptions) {
797
- return __awaiter(this, void 0, void 0, function () {
798
- var _a, _b;
799
- return __generator(this, function (_c) {
800
- switch (_c.label) {
801
- case 0:
802
- _a = "data:" + this.getContentType("xlsx") + ";" + this.get("charset", "utf-8") + ",";
803
- _b = encodeURIComponent;
804
- return [4 /*yield*/, this.getXLSX(customOptions)];
805
- case 1: return [2 /*return*/, _a + _b.apply(void 0, [_c.sent()])];
806
- }
807
- });
808
- });
809
- }
810
- });
621
+ exportXLSX(customOptions) {
622
+ return __awaiter(this, void 0, void 0, function* () {
623
+ return "data:" + this.getContentType("xlsx") + ";" + this.get("charset", "utf-8") + "," + encodeURIComponent(yield this.getXLSX(customOptions));
624
+ });
625
+ }
811
626
  /**
812
627
  * Returns a data:uri of XLSX data.
813
628
  *
814
629
  * @param customOptions Format options
815
630
  * @return Promise
816
631
  */
817
- Object.defineProperty(Exporting.prototype, "getXLSX", {
818
- enumerable: false,
819
- configurable: true,
820
- writable: true,
821
- value: function (customOptions) {
822
- return __awaiter(this, void 0, void 0, function () {
823
- var options, XLSX, wbOptions, sheetName, wb, wsData, data, dataFields, dataFieldsOrder_3, len, i;
824
- var _this = this;
825
- return __generator(this, function (_a) {
826
- switch (_a.label) {
827
- case 0:
828
- options = this._getFormatOptions("xlsx", customOptions);
829
- return [4 /*yield*/, this.getXLSXLib()];
830
- case 1:
831
- XLSX = _a.sent();
832
- wbOptions = {
833
- bookType: "xlsx",
834
- bookSST: false,
835
- type: "base64",
836
- //dateNF: 'yyyy-mm-dd'
837
- };
838
- sheetName = this._normalizeExcelSheetName(this.get("title", this._t("Data")));
839
- wb = {
840
- SheetNames: [sheetName],
841
- Sheets: {}
842
- };
843
- wsData = [];
844
- data = this.getData("html", options);
845
- dataFields = this.getDataFields(data);
846
- // Vertical or horizontal (default) layout
847
- if (options.pivot) {
848
- dataFieldsOrder_3 = this.get("dataFieldsOrder", []);
849
- $object.eachOrdered(dataFields, function (key, val) {
850
- var dataRow = [];
851
- if (options.addColumnNames) {
852
- dataRow.push(val);
853
- }
854
- for (var len = data.length, i = 0; i < len; i++) {
855
- var dataValue = data[i][key];
856
- dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));
857
- }
858
- wsData.push(_this.getXLSXRow(dataRow, options, undefined, true));
859
- }, function (a, b) {
860
- //console.log(a, b)
861
- var ai = dataFieldsOrder_3.indexOf(a);
862
- var bi = dataFieldsOrder_3.indexOf(b);
863
- if (ai > bi) {
864
- return 1;
865
- }
866
- else if (ai < bi) {
867
- return -1;
868
- }
869
- return 0;
870
- });
871
- }
872
- else {
873
- // Add column names?
874
- if (options.addColumnNames) {
875
- wsData.push(this.getXLSXRow(dataFields, options, undefined, true));
876
- }
877
- // Add lines
878
- for (len = data.length, i = 0; i < len; i++) {
879
- wsData.push(this.getXLSXRow(data[i], options, dataFields));
880
- }
881
- }
882
- // Create sheet and add data
883
- wb.Sheets[sheetName] = XLSX.utils.aoa_to_sheet(wsData);
884
- this.events.dispatch("workbookready", {
885
- type: "workbookready",
886
- format: "xlsx",
887
- options: options,
888
- workbook: wb,
889
- workbookOptions: wbOptions,
890
- xlsx: XLSX,
891
- target: this
892
- });
893
- return [2 /*return*/, XLSX.write(wb, wbOptions)];
632
+ getXLSX(customOptions) {
633
+ return __awaiter(this, void 0, void 0, function* () {
634
+ const options = this._getFormatOptions("xlsx", customOptions);
635
+ // Load xlsx
636
+ let XLSX = yield this.getXLSXLib();
637
+ // Create workbook options
638
+ let wbOptions = {
639
+ bookType: "xlsx",
640
+ bookSST: false,
641
+ type: "base64",
642
+ //dateNF: 'yyyy-mm-dd'
643
+ };
644
+ // Get sheet name
645
+ let sheetName = this._normalizeExcelSheetName(this.get("title", this._t("Data")));
646
+ // Create a workbook
647
+ let wb = {
648
+ SheetNames: [sheetName],
649
+ Sheets: {}
650
+ };
651
+ // Init worksheet data
652
+ let wsData = [];
653
+ // Get data
654
+ const data = this.getData("html", options);
655
+ const dataFields = this.getDataFields(data);
656
+ // Vertical or horizontal (default) layout
657
+ if (options.pivot) {
658
+ // Data fields order
659
+ const dataFieldsOrder = this.get("dataFieldsOrder", []);
660
+ $object.eachOrdered(dataFields, (key, val) => {
661
+ let dataRow = [];
662
+ if (options.addColumnNames) {
663
+ dataRow.push(val);
664
+ }
665
+ for (let len = data.length, i = 0; i < len; i++) {
666
+ let dataValue = data[i][key];
667
+ dataRow.push(this.convertToSpecialFormat(key, dataValue, options, true));
894
668
  }
669
+ wsData.push(this.getXLSXRow(dataRow, options, undefined, true));
670
+ }, (a, b) => {
671
+ //console.log(a, b)
672
+ let ai = dataFieldsOrder.indexOf(a);
673
+ let bi = dataFieldsOrder.indexOf(b);
674
+ if (ai > bi) {
675
+ return 1;
676
+ }
677
+ else if (ai < bi) {
678
+ return -1;
679
+ }
680
+ return 0;
895
681
  });
896
- });
897
- }
898
- });
899
- Object.defineProperty(Exporting.prototype, "_normalizeExcelSheetName", {
900
- enumerable: false,
901
- configurable: true,
902
- writable: true,
903
- value: function (name) {
904
- name = name.replace(/([:\\\/?*\[\]]+)/g, " ");
905
- return name.length > 30 ? name.substr(0, 30) + "..." : name;
906
- }
907
- });
908
- /**
909
- * @ignore
910
- */
911
- Object.defineProperty(Exporting.prototype, "getXLSXRow", {
912
- enumerable: false,
913
- configurable: true,
914
- writable: true,
915
- value: function (row, options, dataFields, asIs) {
916
- var _this = this;
917
- if (asIs === void 0) { asIs = false; }
918
- // Init
919
- var items = [];
920
- // Data fields
921
- if (!dataFields) {
922
- dataFields = row;
923
682
  }
924
- // Data fields order
925
- var dataFieldsOrder = this.get("dataFieldsOrder", []);
926
- // Process each row item
927
- $object.eachOrdered(dataFields, function (key, _name) {
928
- // Get value
929
- var value = _this.convertEmptyValue(key, row[key], options);
930
- // Convert dates
931
- var item = asIs ? value : _this.convertToSpecialFormat(key, value, options, true);
932
- items.push(item);
933
- }, function (a, b) {
934
- //console.log(a, b)
935
- var ai = dataFieldsOrder.indexOf(a);
936
- var bi = dataFieldsOrder.indexOf(b);
937
- if (ai > bi) {
938
- return 1;
683
+ else {
684
+ // Add column names?
685
+ if (options.addColumnNames) {
686
+ wsData.push(this.getXLSXRow(dataFields, options, undefined, true));
939
687
  }
940
- else if (ai < bi) {
941
- return -1;
688
+ // Add lines
689
+ for (let len = data.length, i = 0; i < len; i++) {
690
+ wsData.push(this.getXLSXRow(data[i], options, dataFields));
942
691
  }
943
- return 0;
692
+ }
693
+ // Create sheet and add data
694
+ wb.Sheets[sheetName] = XLSX.utils.aoa_to_sheet(wsData);
695
+ this.events.dispatch("workbookready", {
696
+ type: "workbookready",
697
+ format: "xlsx",
698
+ options: options,
699
+ workbook: wb,
700
+ workbookOptions: wbOptions,
701
+ xlsx: XLSX,
702
+ target: this
944
703
  });
945
- return items;
946
- }
947
- });
704
+ return XLSX.write(wb, wbOptions);
705
+ });
706
+ }
707
+ _normalizeExcelSheetName(name) {
708
+ name = name.replace(/([:\\\/?*\[\]]+)/g, " ");
709
+ return name.length > 30 ? name.substr(0, 30) + "..." : name;
710
+ }
948
711
  /**
949
712
  * @ignore
950
713
  */
951
- Object.defineProperty(Exporting.prototype, "_xlsx", {
952
- enumerable: false,
953
- configurable: true,
954
- writable: true,
955
- value: function () {
956
- return __awaiter(this, void 0, void 0, function () {
957
- return __generator(this, function (_a) {
958
- switch (_a.label) {
959
- case 0: return [4 /*yield*/, import(/* webpackChunkName: "xlsx" */ "xlsx/dist/xlsx.core.min.js")];
960
- case 1: return [2 /*return*/, _a.sent()];
961
- }
962
- });
963
- });
714
+ getXLSXRow(row, options, dataFields, asIs = false) {
715
+ // Init
716
+ let items = [];
717
+ // Data fields
718
+ if (!dataFields) {
719
+ dataFields = row;
964
720
  }
965
- });
721
+ // Data fields order
722
+ const dataFieldsOrder = this.get("dataFieldsOrder", []);
723
+ // Process each row item
724
+ $object.eachOrdered(dataFields, (key, _name) => {
725
+ // Get value
726
+ let value = this.convertEmptyValue(key, row[key], options);
727
+ // Convert dates
728
+ let item = asIs ? value : this.convertToSpecialFormat(key, value, options, true);
729
+ items.push(item);
730
+ }, (a, b) => {
731
+ //console.log(a, b)
732
+ let ai = dataFieldsOrder.indexOf(a);
733
+ let bi = dataFieldsOrder.indexOf(b);
734
+ if (ai > bi) {
735
+ return 1;
736
+ }
737
+ else if (ai < bi) {
738
+ return -1;
739
+ }
740
+ return 0;
741
+ });
742
+ return items;
743
+ }
966
744
  /**
967
745
  * @ignore
968
746
  */
969
- Object.defineProperty(Exporting.prototype, "getXLSXLib", {
970
- enumerable: false,
971
- configurable: true,
972
- writable: true,
973
- value: function () {
974
- return this._xlsx();
975
- }
976
- });
747
+ _xlsx() {
748
+ return __awaiter(this, void 0, void 0, function* () {
749
+ return yield import(/* webpackChunkName: "xlsx" */ "xlsx/dist/xlsx.core.min.js");
750
+ });
751
+ }
752
+ /**
753
+ * @ignore
754
+ */
755
+ getXLSXLib() {
756
+ return this._xlsx();
757
+ }
977
758
  /**
978
759
  * ==========================================================================
979
760
  * PDF
@@ -985,50 +766,22 @@ var Exporting = /** @class */ (function (_super) {
985
766
  * @param customOptions Format options
986
767
  * @return Promise
987
768
  */
988
- Object.defineProperty(Exporting.prototype, "exportPDF", {
989
- enumerable: false,
990
- configurable: true,
991
- writable: true,
992
- value: function (customOptions) {
993
- return __awaiter(this, void 0, void 0, function () {
994
- var _a, _b;
995
- return __generator(this, function (_c) {
996
- switch (_c.label) {
997
- case 0:
998
- _a = "data:" + this.getContentType("pdf") + ";" + this.get("charset", "utf-8") + ",";
999
- _b = encodeURIComponent;
1000
- return [4 /*yield*/, this.getPDF(customOptions, true)];
1001
- case 1: return [2 /*return*/, _a + _b.apply(void 0, [_c.sent()])];
1002
- }
1003
- });
1004
- });
1005
- }
1006
- });
769
+ exportPDF(customOptions) {
770
+ return __awaiter(this, void 0, void 0, function* () {
771
+ return "data:" + this.getContentType("pdf") + ";" + this.get("charset", "utf-8") + "," + encodeURIComponent(yield this.getPDF(customOptions, true));
772
+ });
773
+ }
1007
774
  /**
1008
775
  * Returns a data:uri representation of a PDF file with chart data.
1009
776
  *
1010
777
  * @param customOptions Format options
1011
778
  * @return Promise
1012
779
  */
1013
- Object.defineProperty(Exporting.prototype, "exportPDFData", {
1014
- enumerable: false,
1015
- configurable: true,
1016
- writable: true,
1017
- value: function (customOptions) {
1018
- return __awaiter(this, void 0, void 0, function () {
1019
- var _a, _b;
1020
- return __generator(this, function (_c) {
1021
- switch (_c.label) {
1022
- case 0:
1023
- _a = "data:" + this.getContentType("pdf") + ";" + this.get("charset", "utf-8") + ",";
1024
- _b = encodeURIComponent;
1025
- return [4 /*yield*/, this.getPDF(customOptions, false, true)];
1026
- case 1: return [2 /*return*/, _a + _b.apply(void 0, [_c.sent()])];
1027
- }
1028
- });
1029
- });
1030
- }
1031
- });
780
+ exportPDFData(customOptions) {
781
+ return __awaiter(this, void 0, void 0, function* () {
782
+ return "data:" + this.getContentType("pdf") + ";" + this.get("charset", "utf-8") + "," + encodeURIComponent(yield this.getPDF(customOptions, false, true));
783
+ });
784
+ }
1032
785
  /**
1033
786
  * Returns Base64-encoded binary data for a PDF file.
1034
787
  * @param customOptions PDF options
@@ -1036,338 +789,298 @@ var Exporting = /** @class */ (function (_super) {
1036
789
  * @param includeData Include data
1037
790
  * @return Promise
1038
791
  */
1039
- Object.defineProperty(Exporting.prototype, "getPDF", {
1040
- enumerable: false,
1041
- configurable: true,
1042
- writable: true,
1043
- value: function (customOptions, includeImage, includeData) {
1044
- if (includeImage === void 0) { includeImage = true; }
1045
- if (includeData === void 0) { includeData = false; }
1046
- return __awaiter(this, void 0, void 0, function () {
1047
- function addFont(font) {
1048
- var paths = {};
1049
- paths.normal = font.normal.path;
1050
- vfs[font.normal.path] = font.normal.bytes;
1051
- if (font.bold) {
1052
- paths.bold = font.bold.path;
1053
- vfs[font.bold.path] = font.bold.bytes;
1054
- }
1055
- else {
1056
- paths.bold = font.normal.path;
1057
- }
1058
- if (font.italics) {
1059
- paths.italics = font.italics.path;
1060
- vfs[font.italics.path] = font.italics.bytes;
1061
- }
1062
- else {
1063
- paths.italics = font.normal.path;
1064
- }
1065
- if (font.bolditalics) {
1066
- paths.bolditalics = font.bolditalics.path;
1067
- vfs[font.bolditalics.path] = font.bolditalics.bytes;
1068
- }
1069
- else {
1070
- paths.bolditalics = font.normal.path;
1071
- }
1072
- fonts[font.name] = paths;
792
+ getPDF(customOptions, includeImage = true, includeData = false) {
793
+ return __awaiter(this, void 0, void 0, function* () {
794
+ const options = this._getFormatOptions("pdf", customOptions);
795
+ const dataOptions = this._getFormatOptions("pdfdata", customOptions);
796
+ const orientation = options.pageOrientation || "portrait";
797
+ // Get image
798
+ let image;
799
+ if (includeImage) {
800
+ image = yield this.exportImage(options.imageFormat || "png", options);
801
+ }
802
+ // Load pdfmake
803
+ const pdfmake = yield this.getPdfmake();
804
+ // Defaults
805
+ const defaultMargins = [30, 30, 30, 30];
806
+ // Init content for PDF
807
+ let doc = {
808
+ pageSize: options.pageSize || "A4",
809
+ pageOrientation: orientation,
810
+ pageMargins: options.pageMargins || defaultMargins,
811
+ defaultStyle: {
812
+ font: options.font ? options.font.name : undefined
813
+ },
814
+ //header: <any>[],
815
+ content: []
816
+ };
817
+ // Should we add title?
818
+ const title = this.get("title");
819
+ let extraMargin = 0;
820
+ if (title) {
821
+ doc.content.push({
822
+ text: title,
823
+ fontSize: options.fontSize || 14,
824
+ bold: true,
825
+ margin: [0, 0, 0, 15]
826
+ });
827
+ // Add some leftover margin for title
828
+ extraMargin += 50;
829
+ }
830
+ // Add page URL?
831
+ if (options.addURL) {
832
+ doc.content.push({
833
+ text: this._t("Saved from") + ": " + document.location.href,
834
+ fontSize: options.fontSize,
835
+ margin: [0, 0, 0, 15]
836
+ });
837
+ // Add some leftover margin for URL
838
+ extraMargin += 50;
839
+ }
840
+ // Add image
841
+ if (includeImage && image) {
842
+ doc.content.push({
843
+ image: image,
844
+ alignment: options.align || "left",
845
+ fit: this.getPageSizeFit(doc.pageSize, doc.pageMargins, extraMargin, orientation)
846
+ });
847
+ }
848
+ // Add data
849
+ if ((includeData || options.includeData) && this.hasData()) {
850
+ doc.content.push({
851
+ table: yield this.getPDFData(dataOptions),
852
+ fontSize: options.fontSize || 14
853
+ });
854
+ }
855
+ let fonts = null;
856
+ let vfs = null;
857
+ function addFont(font) {
858
+ const paths = {};
859
+ paths.normal = font.normal.path;
860
+ vfs[font.normal.path] = font.normal.bytes;
861
+ if (font.bold) {
862
+ paths.bold = font.bold.path;
863
+ vfs[font.bold.path] = font.bold.bytes;
1073
864
  }
1074
- var options, dataOptions, orientation, image, pdfmake, defaultMargins, doc, title, extraMargin, _a, _b, fonts, vfs;
1075
- var _c;
1076
- return __generator(this, function (_d) {
1077
- switch (_d.label) {
1078
- case 0:
1079
- options = this._getFormatOptions("pdf", customOptions);
1080
- dataOptions = this._getFormatOptions("pdfdata", customOptions);
1081
- orientation = options.pageOrientation || "portrait";
1082
- if (!includeImage) return [3 /*break*/, 2];
1083
- return [4 /*yield*/, this.exportImage(options.imageFormat || "png", options)];
1084
- case 1:
1085
- image = _d.sent();
1086
- _d.label = 2;
1087
- case 2: return [4 /*yield*/, this.getPdfmake()];
1088
- case 3:
1089
- pdfmake = _d.sent();
1090
- defaultMargins = [30, 30, 30, 30];
1091
- doc = {
1092
- pageSize: options.pageSize || "A4",
1093
- pageOrientation: orientation,
1094
- pageMargins: options.pageMargins || defaultMargins,
1095
- defaultStyle: {
1096
- font: options.font ? options.font.name : undefined
1097
- },
1098
- //header: <any>[],
1099
- content: []
1100
- };
1101
- title = this.get("title");
1102
- extraMargin = 0;
1103
- if (title) {
1104
- doc.content.push({
1105
- text: title,
1106
- fontSize: options.fontSize || 14,
1107
- bold: true,
1108
- margin: [0, 0, 0, 15]
1109
- });
1110
- // Add some leftover margin for title
1111
- extraMargin += 50;
1112
- }
1113
- // Add page URL?
1114
- if (options.addURL) {
1115
- doc.content.push({
1116
- text: this._t("Saved from") + ": " + document.location.href,
1117
- fontSize: options.fontSize,
1118
- margin: [0, 0, 0, 15]
1119
- });
1120
- // Add some leftover margin for URL
1121
- extraMargin += 50;
1122
- }
1123
- // Add image
1124
- if (includeImage && image) {
1125
- doc.content.push({
1126
- image: image,
1127
- alignment: options.align || "left",
1128
- fit: this.getPageSizeFit(doc.pageSize, doc.pageMargins, extraMargin, orientation)
1129
- });
1130
- }
1131
- if (!((includeData || options.includeData) && this.hasData())) return [3 /*break*/, 5];
1132
- _b = (_a = doc.content).push;
1133
- _c = {};
1134
- return [4 /*yield*/, this.getPDFData(dataOptions)];
1135
- case 4:
1136
- _b.apply(_a, [(_c.table = _d.sent(),
1137
- _c.fontSize = options.fontSize || 14,
1138
- _c)]);
1139
- _d.label = 5;
1140
- case 5:
1141
- fonts = null;
1142
- vfs = null;
1143
- if (options.font) {
1144
- fonts = {};
1145
- vfs = {};
1146
- addFont(options.font);
1147
- if (options.extraFonts) {
1148
- $array.each(options.extraFonts, addFont);
1149
- }
1150
- }
1151
- this.events.dispatch("pdfdocready", {
1152
- type: "pdfdocready",
1153
- format: "pdf",
1154
- options: options,
1155
- doc: doc,
1156
- target: this
1157
- });
1158
- // Create PDF
1159
- return [2 /*return*/, new Promise(function (success, _error) {
1160
- pdfmake.createPdf(doc, null, fonts, vfs).getBase64(function (uri) {
1161
- success(uri);
1162
- });
1163
- })];
1164
- }
865
+ else {
866
+ paths.bold = font.normal.path;
867
+ }
868
+ if (font.italics) {
869
+ paths.italics = font.italics.path;
870
+ vfs[font.italics.path] = font.italics.bytes;
871
+ }
872
+ else {
873
+ paths.italics = font.normal.path;
874
+ }
875
+ if (font.bolditalics) {
876
+ paths.bolditalics = font.bolditalics.path;
877
+ vfs[font.bolditalics.path] = font.bolditalics.bytes;
878
+ }
879
+ else {
880
+ paths.bolditalics = font.normal.path;
881
+ }
882
+ fonts[font.name] = paths;
883
+ }
884
+ if (options.font) {
885
+ fonts = {};
886
+ vfs = {};
887
+ addFont(options.font);
888
+ if (options.extraFonts) {
889
+ $array.each(options.extraFonts, addFont);
890
+ }
891
+ }
892
+ this.events.dispatch("pdfdocready", {
893
+ type: "pdfdocready",
894
+ format: "pdf",
895
+ options: options,
896
+ doc: doc,
897
+ target: this
898
+ });
899
+ // Create PDF
900
+ return new Promise((success, _error) => {
901
+ pdfmake.createPdf(doc, null, fonts, vfs).getBase64((uri) => {
902
+ success(uri);
1165
903
  });
1166
904
  });
1167
- }
1168
- });
905
+ });
906
+ }
1169
907
  /**
1170
908
  * @ignore
1171
909
  */
1172
- Object.defineProperty(Exporting.prototype, "getPDFData", {
1173
- enumerable: false,
1174
- configurable: true,
1175
- writable: true,
1176
- value: function (customOptions) {
1177
- return __awaiter(this, void 0, void 0, function () {
1178
- var options, content, data, dataFields, dataFieldsOrder_4, len, i;
1179
- var _this = this;
1180
- return __generator(this, function (_a) {
1181
- options = this._getFormatOptions("pdfdata", customOptions);
1182
- content = {
1183
- "body": []
1184
- };
1185
- data = this.getData("html", options);
1186
- dataFields = this.getDataFields(data);
1187
- // Vertical or horizontal (default) layout
1188
- if (options.pivot) {
1189
- dataFieldsOrder_4 = this.get("dataFieldsOrder", []);
1190
- $object.eachOrdered(dataFields, function (key, val) {
1191
- var dataRow = [];
1192
- if (options.addColumnNames) {
1193
- dataRow.push(val);
1194
- }
1195
- for (var len = data.length, i = 0; i < len; i++) {
1196
- var dataValue = data[i][key];
1197
- dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));
1198
- }
1199
- content.body.push(_this.getPDFDataRow(dataRow, options, undefined, true));
1200
- }, function (a, b) {
1201
- //console.log(a, b)
1202
- var ai = dataFieldsOrder_4.indexOf(a);
1203
- var bi = dataFieldsOrder_4.indexOf(b);
1204
- if (ai > bi) {
1205
- return 1;
1206
- }
1207
- else if (ai < bi) {
1208
- return -1;
1209
- }
1210
- return 0;
1211
- });
910
+ getPDFData(customOptions) {
911
+ return __awaiter(this, void 0, void 0, function* () {
912
+ const options = this._getFormatOptions("pdfdata", customOptions);
913
+ // Init output
914
+ let content = {
915
+ "body": []
916
+ };
917
+ // Get data
918
+ const data = this.getData("html", options);
919
+ const dataFields = this.getDataFields(data);
920
+ // Vertical or horizontal (default) layout
921
+ if (options.pivot) {
922
+ // Data fields order
923
+ const dataFieldsOrder = this.get("dataFieldsOrder", []);
924
+ $object.eachOrdered(dataFields, (key, val) => {
925
+ let dataRow = [];
926
+ if (options.addColumnNames) {
927
+ dataRow.push(val);
1212
928
  }
1213
- else {
1214
- // Add column names?
1215
- if (options.addColumnNames) {
1216
- content.body.push(this.getPDFDataRow(dataFields, options, undefined, true));
1217
- content.headerRows = 1;
1218
- }
1219
- for (len = data.length, i = 0; i < len; i++) {
1220
- content.body.push(this.getPDFDataRow(data[i], options, dataFields));
1221
- }
929
+ for (let len = data.length, i = 0; i < len; i++) {
930
+ let dataValue = data[i][key];
931
+ dataRow.push(this.convertToSpecialFormat(key, dataValue, options, true));
932
+ }
933
+ content.body.push(this.getPDFDataRow(dataRow, options, undefined, true));
934
+ }, (a, b) => {
935
+ //console.log(a, b)
936
+ let ai = dataFieldsOrder.indexOf(a);
937
+ let bi = dataFieldsOrder.indexOf(b);
938
+ if (ai > bi) {
939
+ return 1;
1222
940
  }
1223
- return [2 /*return*/, content];
941
+ else if (ai < bi) {
942
+ return -1;
943
+ }
944
+ return 0;
1224
945
  });
1225
- });
1226
- }
1227
- });
1228
- /**
1229
- * @ignore
1230
- */
1231
- Object.defineProperty(Exporting.prototype, "getPDFDataRow", {
1232
- enumerable: false,
1233
- configurable: true,
1234
- writable: true,
1235
- value: function (row, options, dataFields, asIs) {
1236
- var _this = this;
1237
- if (asIs === void 0) { asIs = false; }
1238
- // Init
1239
- var items = [];
1240
- // Data fields
1241
- if (!dataFields) {
1242
- dataFields = row;
1243
946
  }
1244
- // Data fields order
1245
- var dataFieldsOrder = this.get("dataFieldsOrder", []);
1246
- // Process each row item
1247
- $object.eachOrdered(dataFields, function (key, _name) {
1248
- // Get value
1249
- var value = _this.convertEmptyValue(key, row[key], options);
1250
- // Convert dates
1251
- var item = asIs ? value : _this.convertToSpecialFormat(key, value, options);
1252
- item = "" + item;
1253
- // Add to item
1254
- items.push(item);
1255
- }, function (a, b) {
1256
- //console.log(a, b)
1257
- var ai = dataFieldsOrder.indexOf(a);
1258
- var bi = dataFieldsOrder.indexOf(b);
1259
- if (ai > bi) {
1260
- return 1;
947
+ else {
948
+ // Add column names?
949
+ if (options.addColumnNames) {
950
+ content.body.push(this.getPDFDataRow(dataFields, options, undefined, true));
951
+ content.headerRows = 1;
1261
952
  }
1262
- else if (ai < bi) {
1263
- return -1;
953
+ for (let len = data.length, i = 0; i < len; i++) {
954
+ content.body.push(this.getPDFDataRow(data[i], options, dataFields));
1264
955
  }
1265
- return 0;
1266
- });
1267
- return items;
956
+ }
957
+ return content;
958
+ });
959
+ }
960
+ /**
961
+ * @ignore
962
+ */
963
+ getPDFDataRow(row, options, dataFields, asIs = false) {
964
+ // Init
965
+ let items = [];
966
+ // Data fields
967
+ if (!dataFields) {
968
+ dataFields = row;
1268
969
  }
1269
- });
970
+ // Data fields order
971
+ const dataFieldsOrder = this.get("dataFieldsOrder", []);
972
+ // Process each row item
973
+ $object.eachOrdered(dataFields, (key, _name) => {
974
+ // Get value
975
+ let value = this.convertEmptyValue(key, row[key], options);
976
+ // Convert dates
977
+ let item = asIs ? value : this.convertToSpecialFormat(key, value, options);
978
+ item = "" + item;
979
+ // Add to item
980
+ items.push(item);
981
+ }, (a, b) => {
982
+ //console.log(a, b)
983
+ let ai = dataFieldsOrder.indexOf(a);
984
+ let bi = dataFieldsOrder.indexOf(b);
985
+ if (ai > bi) {
986
+ return 1;
987
+ }
988
+ else if (ai < bi) {
989
+ return -1;
990
+ }
991
+ return 0;
992
+ });
993
+ return items;
994
+ }
1270
995
  /**
1271
996
  * Returns pdfmake instance.
1272
997
  *
1273
998
  * @ignore
1274
999
  * @return Instance of pdfmake
1275
1000
  */
1276
- Object.defineProperty(Exporting.prototype, "getPdfmake", {
1277
- enumerable: false,
1278
- configurable: true,
1279
- writable: true,
1280
- value: function () {
1281
- if (pdfmakePromise === undefined) {
1282
- pdfmakePromise = _pdfmake();
1283
- }
1284
- return pdfmakePromise;
1001
+ getPdfmake() {
1002
+ if (pdfmakePromise === undefined) {
1003
+ pdfmakePromise = _pdfmake();
1285
1004
  }
1286
- });
1005
+ return pdfmakePromise;
1006
+ }
1287
1007
  /**
1288
1008
  * @ignore
1289
1009
  */
1290
- Object.defineProperty(Exporting.prototype, "getPageSizeFit", {
1291
- enumerable: false,
1292
- configurable: true,
1293
- writable: true,
1294
- value: function (pageSize, margins, extraMargin, orientation) {
1295
- if (extraMargin === void 0) { extraMargin = 0; }
1296
- if (orientation === void 0) { orientation = "portrait"; }
1297
- // Check margins
1298
- var newMargins = [0, 0, 0, 0];
1299
- if ($type.isNumber(margins)) {
1300
- newMargins = [margins, margins, margins, margins];
1301
- }
1302
- else if (margins.length == 2) {
1303
- newMargins = [margins[0], margins[1], margins[0], margins[1]];
1304
- }
1305
- else if (margins.length == 4) {
1306
- newMargins = margins;
1307
- }
1308
- // Define available page sizes
1309
- var sizes = {
1310
- "4A0": [4767.87, 6740.79],
1311
- "2A0": [3370.39, 4767.87],
1312
- A0: [2383.94, 3370.39],
1313
- A1: [1683.78, 2383.94],
1314
- A2: [1190.55, 1683.78],
1315
- A3: [841.89, 1190.55],
1316
- A4: [595.28, 841.89],
1317
- A5: [419.53, 595.28],
1318
- A6: [297.64, 419.53],
1319
- A7: [209.76, 297.64],
1320
- A8: [147.40, 209.76],
1321
- A9: [104.88, 147.40],
1322
- A10: [73.70, 104.88],
1323
- B0: [2834.65, 4008.19],
1324
- B1: [2004.09, 2834.65],
1325
- B2: [1417.32, 2004.09],
1326
- B3: [1000.63, 1417.32],
1327
- B4: [708.66, 1000.63],
1328
- B5: [498.90, 708.66],
1329
- B6: [354.33, 498.90],
1330
- B7: [249.45, 354.33],
1331
- B8: [175.75, 249.45],
1332
- B9: [124.72, 175.75],
1333
- B10: [87.87, 124.72],
1334
- C0: [2599.37, 3676.54],
1335
- C1: [1836.85, 2599.37],
1336
- C2: [1298.27, 1836.85],
1337
- C3: [918.43, 1298.27],
1338
- C4: [649.13, 918.43],
1339
- C5: [459.21, 649.13],
1340
- C6: [323.15, 459.21],
1341
- C7: [229.61, 323.15],
1342
- C8: [161.57, 229.61],
1343
- C9: [113.39, 161.57],
1344
- C10: [79.37, 113.39],
1345
- RA0: [2437.80, 3458.27],
1346
- RA1: [1729.13, 2437.80],
1347
- RA2: [1218.90, 1729.13],
1348
- RA3: [864.57, 1218.90],
1349
- RA4: [609.45, 864.57],
1350
- SRA0: [2551.18, 3628.35],
1351
- SRA1: [1814.17, 2551.18],
1352
- SRA2: [1275.59, 1814.17],
1353
- SRA3: [907.09, 1275.59],
1354
- SRA4: [637.80, 907.09],
1355
- EXECUTIVE: [521.86, 756.00],
1356
- FOLIO: [612.00, 936.00],
1357
- LEGAL: [612.00, 1008.00],
1358
- LETTER: [612.00, 792.00],
1359
- TABLOID: [792.00, 1224.00]
1360
- };
1361
- // Calculate size
1362
- var fitSize = sizes[pageSize];
1363
- if (orientation == "landscape") {
1364
- fitSize.reverse();
1365
- }
1366
- fitSize[0] -= newMargins[0] + newMargins[2];
1367
- fitSize[1] -= newMargins[1] + newMargins[3] + extraMargin;
1368
- return fitSize;
1010
+ getPageSizeFit(pageSize, margins, extraMargin = 0, orientation = "portrait") {
1011
+ // Check margins
1012
+ let newMargins = [0, 0, 0, 0];
1013
+ if ($type.isNumber(margins)) {
1014
+ newMargins = [margins, margins, margins, margins];
1369
1015
  }
1370
- });
1016
+ else if (margins.length == 2) {
1017
+ newMargins = [margins[0], margins[1], margins[0], margins[1]];
1018
+ }
1019
+ else if (margins.length == 4) {
1020
+ newMargins = margins;
1021
+ }
1022
+ // Define available page sizes
1023
+ let sizes = {
1024
+ "4A0": [4767.87, 6740.79],
1025
+ "2A0": [3370.39, 4767.87],
1026
+ A0: [2383.94, 3370.39],
1027
+ A1: [1683.78, 2383.94],
1028
+ A2: [1190.55, 1683.78],
1029
+ A3: [841.89, 1190.55],
1030
+ A4: [595.28, 841.89],
1031
+ A5: [419.53, 595.28],
1032
+ A6: [297.64, 419.53],
1033
+ A7: [209.76, 297.64],
1034
+ A8: [147.40, 209.76],
1035
+ A9: [104.88, 147.40],
1036
+ A10: [73.70, 104.88],
1037
+ B0: [2834.65, 4008.19],
1038
+ B1: [2004.09, 2834.65],
1039
+ B2: [1417.32, 2004.09],
1040
+ B3: [1000.63, 1417.32],
1041
+ B4: [708.66, 1000.63],
1042
+ B5: [498.90, 708.66],
1043
+ B6: [354.33, 498.90],
1044
+ B7: [249.45, 354.33],
1045
+ B8: [175.75, 249.45],
1046
+ B9: [124.72, 175.75],
1047
+ B10: [87.87, 124.72],
1048
+ C0: [2599.37, 3676.54],
1049
+ C1: [1836.85, 2599.37],
1050
+ C2: [1298.27, 1836.85],
1051
+ C3: [918.43, 1298.27],
1052
+ C4: [649.13, 918.43],
1053
+ C5: [459.21, 649.13],
1054
+ C6: [323.15, 459.21],
1055
+ C7: [229.61, 323.15],
1056
+ C8: [161.57, 229.61],
1057
+ C9: [113.39, 161.57],
1058
+ C10: [79.37, 113.39],
1059
+ RA0: [2437.80, 3458.27],
1060
+ RA1: [1729.13, 2437.80],
1061
+ RA2: [1218.90, 1729.13],
1062
+ RA3: [864.57, 1218.90],
1063
+ RA4: [609.45, 864.57],
1064
+ SRA0: [2551.18, 3628.35],
1065
+ SRA1: [1814.17, 2551.18],
1066
+ SRA2: [1275.59, 1814.17],
1067
+ SRA3: [907.09, 1275.59],
1068
+ SRA4: [637.80, 907.09],
1069
+ EXECUTIVE: [521.86, 756.00],
1070
+ FOLIO: [612.00, 936.00],
1071
+ LEGAL: [612.00, 1008.00],
1072
+ LETTER: [612.00, 792.00],
1073
+ TABLOID: [792.00, 1224.00]
1074
+ };
1075
+ // Calculate size
1076
+ let fitSize = sizes[pageSize];
1077
+ if (orientation == "landscape") {
1078
+ fitSize.reverse();
1079
+ }
1080
+ fitSize[0] -= newMargins[0] + newMargins[2];
1081
+ fitSize[1] -= newMargins[1] + newMargins[3] + extraMargin;
1082
+ return fitSize;
1083
+ }
1371
1084
  /**
1372
1085
  * ==========================================================================
1373
1086
  * Data
@@ -1379,15 +1092,10 @@ var Exporting = /** @class */ (function (_super) {
1379
1092
  *
1380
1093
  * @return Has data?
1381
1094
  */
1382
- Object.defineProperty(Exporting.prototype, "hasData", {
1383
- enumerable: false,
1384
- configurable: true,
1385
- writable: true,
1386
- value: function () {
1387
- var dataSource = this.get("dataSource");
1388
- return $type.isArray(dataSource) && dataSource.length ? true : false;
1389
- }
1390
- });
1095
+ hasData() {
1096
+ const dataSource = this.get("dataSource");
1097
+ return $type.isArray(dataSource) && dataSource.length ? true : false;
1098
+ }
1391
1099
  /**
1392
1100
  * Returns processed data according to format options.
1393
1101
  *
@@ -1396,235 +1104,178 @@ var Exporting = /** @class */ (function (_super) {
1396
1104
  * @param renameFields Should fields be renamed?
1397
1105
  * @return Processed data
1398
1106
  */
1399
- Object.defineProperty(Exporting.prototype, "getData", {
1400
- enumerable: false,
1401
- configurable: true,
1402
- writable: true,
1403
- value: function (format, customOptions, renameFields) {
1404
- var _this = this;
1405
- if (renameFields === void 0) { renameFields = false; }
1406
- var options = this._getFormatOptions(format, customOptions);
1407
- var dataSource = this.get("dataSource", []);
1408
- var data = dataSource;
1409
- // Re-generate the data based on data fields if set
1410
- var dataFields = this.get("dataFields");
1411
- if (dataFields && $type.isArray(dataSource)) {
1412
- data = [];
1413
- $array.each(dataSource, function (row) {
1414
- if ($type.isObject(row)) {
1415
- var newRow_1 = {};
1416
- $object.each(dataFields, function (field, value) {
1417
- if (dataFields[field] != null) {
1418
- newRow_1[renameFields ? value : field] = _this.convertToSpecialFormat(field, row[field], options);
1419
- }
1420
- });
1421
- data.push(newRow_1);
1422
- }
1423
- });
1424
- }
1425
- var event = {
1426
- type: "dataprocessed",
1427
- format: format,
1428
- options: options,
1429
- data: data,
1430
- target: this
1431
- };
1432
- this.events.dispatch("dataprocessed", event);
1433
- return event.data;
1107
+ getData(format, customOptions, renameFields = false) {
1108
+ const options = this._getFormatOptions(format, customOptions);
1109
+ const dataSource = this.get("dataSource", []);
1110
+ let data = dataSource;
1111
+ // Re-generate the data based on data fields if set
1112
+ const dataFields = this.get("dataFields");
1113
+ if (dataFields && $type.isArray(dataSource)) {
1114
+ data = [];
1115
+ $array.each(dataSource, (row) => {
1116
+ if ($type.isObject(row)) {
1117
+ const newRow = {};
1118
+ $object.each(dataFields, (field, value) => {
1119
+ if (dataFields[field] != null) {
1120
+ newRow[renameFields ? value : field] = this.convertToSpecialFormat(field, row[field], options);
1121
+ }
1122
+ });
1123
+ data.push(newRow);
1124
+ }
1125
+ });
1434
1126
  }
1435
- });
1127
+ const event = {
1128
+ type: "dataprocessed",
1129
+ format: format,
1130
+ options: options,
1131
+ data: data,
1132
+ target: this
1133
+ };
1134
+ this.events.dispatch("dataprocessed", event);
1135
+ return event.data;
1136
+ }
1436
1137
  /**
1437
1138
  * @ignore
1438
1139
  */
1439
- Object.defineProperty(Exporting.prototype, "getDataFields", {
1440
- enumerable: false,
1441
- configurable: true,
1442
- writable: true,
1443
- value: function (data) {
1444
- var dataFields = this.get("dataFields");
1445
- if (!dataFields) {
1446
- dataFields = {};
1447
- if ($type.isArray(data) && data.length) {
1448
- $array.each(data, function (row) {
1449
- $object.each(row, function (key, _value) {
1450
- if (dataFields[key] == null) {
1451
- dataFields[key] = key;
1452
- }
1453
- });
1140
+ getDataFields(data) {
1141
+ let dataFields = this.get("dataFields");
1142
+ if (!dataFields) {
1143
+ dataFields = {};
1144
+ if ($type.isArray(data) && data.length) {
1145
+ $array.each(data, (row) => {
1146
+ $object.each(row, (key, _value) => {
1147
+ if (dataFields[key] == null) {
1148
+ dataFields[key] = key;
1149
+ }
1454
1150
  });
1455
- }
1151
+ });
1456
1152
  }
1457
- return dataFields;
1458
1153
  }
1459
- });
1154
+ return dataFields;
1155
+ }
1460
1156
  /**
1461
1157
  * @ignore
1462
1158
  */
1463
- Object.defineProperty(Exporting.prototype, "convertEmptyValue", {
1464
- enumerable: false,
1465
- configurable: true,
1466
- writable: true,
1467
- value: function (_field, value, options) {
1468
- return value != null ? value : options.emptyAs;
1469
- }
1470
- });
1159
+ convertEmptyValue(_field, value, options) {
1160
+ return value != null ? value : options.emptyAs;
1161
+ }
1471
1162
  /**
1472
1163
  * @ignore
1473
1164
  */
1474
- Object.defineProperty(Exporting.prototype, "convertToSpecialFormat", {
1475
- enumerable: false,
1476
- configurable: true,
1477
- writable: true,
1478
- value: function (field, value, options, keepOriginal) {
1479
- // Is this a timestamp or duration?
1480
- if (typeof value == "number") {
1481
- if (this.isDateField(field)) {
1482
- value = new Date(value);
1483
- }
1484
- else if (this.isNumericField(field) && this.get("numberFormat")) {
1485
- return this._root.numberFormatter.format(value, this.get("numberFormat"));
1486
- }
1487
- else if (this.isDurationField(field)) {
1488
- return this._root.durationFormatter.format(value, this.get("durationFormat"), this.get("durationUnit"));
1489
- }
1165
+ convertToSpecialFormat(field, value, options, keepOriginal) {
1166
+ // Is this a timestamp or duration?
1167
+ if (typeof value == "number") {
1168
+ if (this.isDateField(field)) {
1169
+ value = new Date(value);
1490
1170
  }
1491
- if (value instanceof Date) {
1492
- if (options.useTimestamps) {
1493
- value = value.getTime();
1494
- }
1495
- else if (options.useLocale) {
1496
- if (!keepOriginal) {
1497
- value = value.toLocaleString();
1498
- }
1499
- }
1500
- else {
1501
- value = this._root.dateFormatter.format(value, this.get("dateFormat"));
1171
+ else if (this.isNumericField(field) && this.get("numberFormat")) {
1172
+ return this._root.numberFormatter.format(value, this.get("numberFormat"));
1173
+ }
1174
+ else if (this.isDurationField(field)) {
1175
+ return this._root.durationFormatter.format(value, this.get("durationFormat"), this.get("durationUnit"));
1176
+ }
1177
+ }
1178
+ if (value instanceof Date) {
1179
+ if (options.useTimestamps) {
1180
+ value = value.getTime();
1181
+ }
1182
+ else if (options.useLocale) {
1183
+ if (!keepOriginal) {
1184
+ value = value.toLocaleString();
1502
1185
  }
1503
1186
  }
1504
- return value;
1187
+ else {
1188
+ value = this._root.dateFormatter.format(value, this.get("dateFormat"));
1189
+ }
1505
1190
  }
1506
- });
1191
+ return value;
1192
+ }
1507
1193
  /**
1508
1194
  * @ignore
1509
1195
  */
1510
- Object.defineProperty(Exporting.prototype, "isDateField", {
1511
- enumerable: false,
1512
- configurable: true,
1513
- writable: true,
1514
- value: function (field) {
1515
- return this.get("dateFields").indexOf(field) !== -1;
1516
- }
1517
- });
1196
+ isDateField(field) {
1197
+ return this.get("dateFields").indexOf(field) !== -1;
1198
+ }
1518
1199
  /**
1519
1200
  * @ignore
1520
1201
  */
1521
- Object.defineProperty(Exporting.prototype, "isNumericField", {
1522
- enumerable: false,
1523
- configurable: true,
1524
- writable: true,
1525
- value: function (field) {
1526
- return this.get("numericFields").indexOf(field) !== -1;
1527
- }
1528
- });
1202
+ isNumericField(field) {
1203
+ return this.get("numericFields").indexOf(field) !== -1;
1204
+ }
1529
1205
  /**
1530
1206
  * @ignore
1531
1207
  */
1532
- Object.defineProperty(Exporting.prototype, "isDurationField", {
1533
- enumerable: false,
1534
- configurable: true,
1535
- writable: true,
1536
- value: function (field) {
1537
- return this.get("durationFields").indexOf(field) !== -1;
1538
- }
1539
- });
1208
+ isDurationField(field) {
1209
+ return this.get("durationFields").indexOf(field) !== -1;
1210
+ }
1540
1211
  /**
1541
1212
  * @ignore
1542
1213
  */
1543
- Object.defineProperty(Exporting.prototype, "getContentType", {
1544
- enumerable: false,
1545
- configurable: true,
1546
- writable: true,
1547
- value: function (type) {
1548
- var contentType = "";
1549
- switch (type) {
1550
- case "png":
1551
- contentType = "image/" + type;
1552
- break;
1553
- case "jpg":
1554
- contentType = "image/jpeg";
1555
- break;
1556
- case "csv":
1557
- contentType = "text/csv";
1558
- break;
1559
- case "json":
1560
- contentType = "application/json";
1561
- break;
1562
- case "html":
1563
- contentType = "text/html";
1564
- break;
1565
- case "pdf":
1566
- case "pdfdata":
1567
- contentType = "application/pdf";
1568
- break;
1569
- case "xlsx":
1570
- contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
1571
- break;
1572
- default:
1573
- contentType = "application/octet-stream";
1574
- }
1575
- return contentType;
1576
- }
1577
- });
1578
- Object.defineProperty(Exporting.prototype, "getDisposableCanvas", {
1579
- enumerable: false,
1580
- configurable: true,
1581
- writable: true,
1582
- value: function () {
1583
- var canvas = document.createElement("canvas");
1584
- canvas.style.position = "fixed";
1585
- canvas.style.top = "-10000px";
1586
- this._root.dom.appendChild(canvas);
1587
- return canvas;
1214
+ getContentType(type) {
1215
+ let contentType = "";
1216
+ switch (type) {
1217
+ case "png":
1218
+ contentType = "image/" + type;
1219
+ break;
1220
+ case "jpg":
1221
+ contentType = "image/jpeg";
1222
+ break;
1223
+ case "csv":
1224
+ contentType = "text/csv";
1225
+ break;
1226
+ case "json":
1227
+ contentType = "application/json";
1228
+ break;
1229
+ case "html":
1230
+ contentType = "text/html";
1231
+ break;
1232
+ case "pdf":
1233
+ case "pdfdata":
1234
+ contentType = "application/pdf";
1235
+ break;
1236
+ case "xlsx":
1237
+ contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
1238
+ break;
1239
+ default:
1240
+ contentType = "application/octet-stream";
1588
1241
  }
1589
- });
1590
- Object.defineProperty(Exporting.prototype, "disposeCanvas", {
1591
- enumerable: false,
1592
- configurable: true,
1593
- writable: true,
1594
- value: function (canvas) {
1595
- this._root.dom.removeChild(canvas);
1596
- }
1597
- });
1242
+ return contentType;
1243
+ }
1244
+ getDisposableCanvas() {
1245
+ let canvas = document.createElement("canvas");
1246
+ canvas.style.position = "fixed";
1247
+ canvas.style.top = "-10000px";
1248
+ this._root.dom.appendChild(canvas);
1249
+ return canvas;
1250
+ }
1251
+ disposeCanvas(canvas) {
1252
+ this._root.dom.removeChild(canvas);
1253
+ }
1598
1254
  /**
1599
1255
  * @ignore
1600
1256
  */
1601
- Object.defineProperty(Exporting.prototype, "findBackgroundColor", {
1602
- enumerable: false,
1603
- configurable: true,
1604
- writable: true,
1605
- value: function (element) {
1606
- // Check if element has styles set
1607
- var opacity = 1;
1608
- var currentColor = getComputedStyle(element, "background-color").getPropertyValue("background-color");
1609
- // Check opacity
1610
- if (currentColor.match(/[^,]*,[^,]*,[^,]*,[ ]?0/) || currentColor == "transparent") {
1611
- opacity = 0;
1612
- }
1613
- if (opacity == 0) {
1614
- var parent_1 = element.parentElement; // || <Element>element.parentNode;
1615
- // Completely transparent. Look for a parent
1616
- if (parent_1) {
1617
- return this.findBackgroundColor(parent_1);
1618
- }
1619
- else {
1620
- return Color.fromHex(0xffffff);
1621
- }
1257
+ findBackgroundColor(element) {
1258
+ // Check if element has styles set
1259
+ let opacity = 1;
1260
+ let currentColor = getComputedStyle(element, "background-color").getPropertyValue("background-color");
1261
+ // Check opacity
1262
+ if (currentColor.match(/[^,]*,[^,]*,[^,]*,[ ]?0/) || currentColor == "transparent") {
1263
+ opacity = 0;
1264
+ }
1265
+ if (opacity == 0) {
1266
+ let parent = element.parentElement; // || <Element>element.parentNode;
1267
+ // Completely transparent. Look for a parent
1268
+ if (parent) {
1269
+ return this.findBackgroundColor(parent);
1622
1270
  }
1623
1271
  else {
1624
- return Color.fromCSS(currentColor);
1272
+ return Color.fromHex(0xffffff);
1625
1273
  }
1626
1274
  }
1627
- });
1275
+ else {
1276
+ return Color.fromCSS(currentColor);
1277
+ }
1278
+ }
1628
1279
  /**
1629
1280
  * Triggers download of the file.
1630
1281
  *
@@ -1633,126 +1284,105 @@ var Exporting = /** @class */ (function (_super) {
1633
1284
  * @param addBOM Should download include byte order mark?
1634
1285
  * @return Promise
1635
1286
  */
1636
- Object.defineProperty(Exporting.prototype, "streamFile", {
1637
- enumerable: false,
1638
- configurable: true,
1639
- writable: true,
1640
- value: function (uri, fileName, addBOM) {
1641
- if (addBOM === void 0) { addBOM = false; }
1642
- if (this.blobDownloadSupport()) {
1643
- /**
1644
- * Supports Blob object.
1645
- * Use it.
1646
- */
1647
- var link_1 = document.createElement("a");
1648
- link_1.download = fileName;
1649
- document.body.appendChild(link_1);
1650
- // Extract content type and get pure data without headers
1651
- var parts = uri.split(";");
1652
- var contentType = parts.shift().replace(/data:/, "");
1653
- uri = decodeURIComponent(parts.join(";").replace(/^[^,]*,/, ""));
1654
- if (["image/svg+xml", "application/json", "text/csv", "text/html"].indexOf(contentType) == -1) {
1655
- try {
1656
- var decoded = atob(uri);
1657
- uri = decoded;
1658
- }
1659
- catch (e) {
1660
- // Error occurred, meaning string was not Base64-encoded. Do nothing.
1661
- return false;
1662
- }
1663
- }
1664
- else {
1665
- if (addBOM) {
1666
- uri = "\ufeff" + uri;
1667
- }
1668
- var blob_1 = new Blob([uri], { type: contentType });
1669
- var url_1 = window.URL.createObjectURL(blob_1);
1670
- link_1.href = url_1;
1671
- link_1.download = fileName;
1672
- link_1.click();
1673
- setTimeout(function () {
1674
- document.body.removeChild(link_1);
1675
- window.URL.revokeObjectURL(url_1);
1676
- }, 100);
1677
- return true;
1287
+ streamFile(uri, fileName, addBOM = false) {
1288
+ if (this.blobDownloadSupport()) {
1289
+ /**
1290
+ * Supports Blob object.
1291
+ * Use it.
1292
+ */
1293
+ let link = document.createElement("a");
1294
+ link.download = fileName;
1295
+ document.body.appendChild(link);
1296
+ // Extract content type and get pure data without headers
1297
+ let parts = uri.split(";");
1298
+ let contentType = parts.shift().replace(/data:/, "");
1299
+ uri = decodeURIComponent(parts.join(";").replace(/^[^,]*,/, ""));
1300
+ if (["image/svg+xml", "application/json", "text/csv", "text/html"].indexOf(contentType) == -1) {
1301
+ try {
1302
+ let decoded = atob(uri);
1303
+ uri = decoded;
1678
1304
  }
1679
- // Dissect uri into array
1680
- var chars = new Array(uri.length);
1681
- for (var i = 0; i < uri.length; ++i) {
1682
- var charCode = uri.charCodeAt(i);
1683
- chars[i] = charCode;
1305
+ catch (e) {
1306
+ // Error occurred, meaning string was not Base64-encoded. Do nothing.
1307
+ return false;
1684
1308
  }
1309
+ }
1310
+ else {
1685
1311
  if (addBOM) {
1686
- chars = [0xEF, 0xBB, 0xBF].concat(chars);
1312
+ uri = "\ufeff" + uri;
1687
1313
  }
1688
- var blob = new Blob([new Uint8Array(chars)], { type: contentType });
1689
- var url_2 = window.URL.createObjectURL(blob);
1690
- link_1.href = url_2;
1691
- link_1.download = fileName;
1692
- document.body.appendChild(link_1);
1693
- link_1.click();
1694
- document.body.removeChild(link_1);
1695
- setTimeout(function () {
1696
- window.URL.revokeObjectURL(url_2);
1697
- }, 100);
1698
- }
1699
- else if (this.linkDownloadSupport()) {
1700
- /**
1701
- * For regular browsers, we create a link then simulate a click on it
1702
- */
1703
- var link = document.createElement("a");
1314
+ let blob = new Blob([uri], { type: contentType });
1315
+ let url = window.URL.createObjectURL(blob);
1316
+ link.href = url;
1704
1317
  link.download = fileName;
1705
- link.href = uri;
1706
- document.body.appendChild(link);
1707
1318
  link.click();
1708
- document.body.removeChild(link);
1319
+ setTimeout(() => {
1320
+ document.body.removeChild(link);
1321
+ window.URL.revokeObjectURL(url);
1322
+ }, 100);
1323
+ return true;
1709
1324
  }
1710
- else {
1711
- /**
1712
- * Something else - perhaps a mobile.
1713
- * Let's just display it in the same page.
1714
- * (hey we don't like it either)
1715
- */
1716
- window.location.href = uri;
1325
+ // Dissect uri into array
1326
+ let chars = new Array(uri.length);
1327
+ for (let i = 0; i < uri.length; ++i) {
1328
+ let charCode = uri.charCodeAt(i);
1329
+ chars[i] = charCode;
1717
1330
  }
1718
- return true;
1331
+ if (addBOM) {
1332
+ chars = [0xEF, 0xBB, 0xBF].concat(chars);
1333
+ }
1334
+ let blob = new Blob([new Uint8Array(chars)], { type: contentType });
1335
+ let url = window.URL.createObjectURL(blob);
1336
+ link.href = url;
1337
+ link.download = fileName;
1338
+ document.body.appendChild(link);
1339
+ link.click();
1340
+ document.body.removeChild(link);
1341
+ setTimeout(() => {
1342
+ window.URL.revokeObjectURL(url);
1343
+ }, 100);
1719
1344
  }
1720
- });
1345
+ else if (this.linkDownloadSupport()) {
1346
+ /**
1347
+ * For regular browsers, we create a link then simulate a click on it
1348
+ */
1349
+ let link = document.createElement("a");
1350
+ link.download = fileName;
1351
+ link.href = uri;
1352
+ document.body.appendChild(link);
1353
+ link.click();
1354
+ document.body.removeChild(link);
1355
+ }
1356
+ else {
1357
+ /**
1358
+ * Something else - perhaps a mobile.
1359
+ * Let's just display it in the same page.
1360
+ * (hey we don't like it either)
1361
+ */
1362
+ window.location.href = uri;
1363
+ }
1364
+ return true;
1365
+ }
1721
1366
  /**
1722
1367
  * @ignore
1723
1368
  */
1724
- Object.defineProperty(Exporting.prototype, "downloadSupport", {
1725
- enumerable: false,
1726
- configurable: true,
1727
- writable: true,
1728
- value: function () {
1729
- return this.linkDownloadSupport();
1730
- }
1731
- });
1369
+ downloadSupport() {
1370
+ return this.linkDownloadSupport();
1371
+ }
1732
1372
  /**
1733
1373
  * @ignore
1734
1374
  */
1735
- Object.defineProperty(Exporting.prototype, "linkDownloadSupport", {
1736
- enumerable: false,
1737
- configurable: true,
1738
- writable: true,
1739
- value: function () {
1740
- var a = document.createElement("a");
1741
- var res = typeof a.download !== "undefined";
1742
- return res;
1743
- }
1744
- });
1375
+ linkDownloadSupport() {
1376
+ let a = document.createElement("a");
1377
+ let res = typeof a.download !== "undefined";
1378
+ return res;
1379
+ }
1745
1380
  /**
1746
1381
  * @ignore
1747
1382
  */
1748
- Object.defineProperty(Exporting.prototype, "blobDownloadSupport", {
1749
- enumerable: false,
1750
- configurable: true,
1751
- writable: true,
1752
- value: function () {
1753
- return window.Blob != null;
1754
- }
1755
- });
1383
+ blobDownloadSupport() {
1384
+ return window.Blob != null;
1385
+ }
1756
1386
  /**
1757
1387
  * ==========================================================================
1758
1388
  * Print
@@ -1766,193 +1396,165 @@ var Exporting = /** @class */ (function (_super) {
1766
1396
  * @param title Optional title to use (uses window's title by default)
1767
1397
  * @return Promise
1768
1398
  */
1769
- Object.defineProperty(Exporting.prototype, "initiatePrint", {
1770
- enumerable: false,
1771
- configurable: true,
1772
- writable: true,
1773
- value: function (data, customOptions, title) {
1774
- var options = this._getFormatOptions("print", customOptions);
1775
- if (options.printMethod == "css") {
1776
- this._printViaCSS(data, options, title);
1777
- }
1778
- else {
1779
- this._printViaIframe(data, options, title);
1780
- }
1399
+ initiatePrint(data, customOptions, title) {
1400
+ const options = this._getFormatOptions("print", customOptions);
1401
+ if (options.printMethod == "css") {
1402
+ this._printViaCSS(data, options, title);
1781
1403
  }
1782
- });
1783
- Object.defineProperty(Exporting.prototype, "_printViaCSS", {
1784
- enumerable: false,
1785
- configurable: true,
1786
- writable: true,
1787
- value: function (data, customOptions, title) {
1788
- var options = this._getFormatOptions("print", customOptions);
1789
- var delay = options.delay || 500;
1790
- //Save current scroll position
1791
- var scroll = document.documentElement.scrollTop || document.body.scrollTop;
1792
- // Hide all document nodes by applyin custom CSS
1793
- var rule = new StyleRule($utils.getShadowRoot(this._root.dom), "body > *", {
1794
- "display": "none",
1795
- "position": "fixed",
1796
- "visibility": "hidden",
1797
- "opacity": "0",
1798
- "clipPath": "polygon(0px 0px,0px 0px,0px 0px,0px 0px);"
1799
- }, this._root.nonce);
1800
- // Replace title?
1801
- var originalTitle;
1802
- if (title && document && document.title) {
1803
- originalTitle = document.title;
1804
- document.title = title;
1805
- }
1806
- // Create and add exported image
1807
- var img = new Image();
1808
- img.src = data;
1809
- img.style.maxWidth = "100%";
1810
- img.style.display = "block";
1811
- img.style.position = "relative";
1812
- img.style.visibility = "visible";
1813
- img.style.opacity = "1";
1814
- img.style.clipPath = "none";
1815
- document.body.appendChild(img);
1816
- // Print
1817
- this.setTimeout(function () {
1818
- window.print();
1819
- }, 50);
1820
- // Delay needs to be at least a second for iOS devices
1821
- var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
1822
- if (isIOS && (delay < 1000)) {
1823
- delay = 1000;
1824
- }
1825
- else if (delay < 100) {
1826
- delay = 100;
1827
- }
1828
- // Delay function that resets back the document the way ot was before
1829
- this.setTimeout(function () {
1830
- // Remove image
1831
- document.body.removeChild(img);
1832
- // Reset back all elements
1833
- /*for (let len = items.length, i = 0; i < len; i++) {
1834
- let item = <HTMLElement>items[i];
1835
- if ($dom.isElement(item)) {
1836
- item.style.display = states[i];
1837
- }
1838
- }*/
1839
- rule.dispose();
1840
- // Restore title
1841
- if (originalTitle) {
1842
- document.title = document.title;
1843
- }
1844
- // Scroll back the document the way it was before
1845
- document.documentElement.scrollTop = document.body.scrollTop = scroll;
1846
- }, delay || 500);
1404
+ else {
1405
+ this._printViaIframe(data, options, title);
1847
1406
  }
1848
- });
1849
- Object.defineProperty(Exporting.prototype, "_printViaIframe", {
1850
- enumerable: false,
1851
- configurable: true,
1852
- writable: true,
1853
- value: function (data, customOptions, title) {
1854
- var options = this._getFormatOptions("print", customOptions);
1855
- var delay = options.delay || 500;
1856
- // Create an iframe
1857
- var iframe = document.createElement("iframe");
1858
- iframe.style.visibility = "hidden";
1859
- document.body.appendChild(iframe);
1860
- // This is needed for FireFox
1861
- iframe.contentWindow.document.open();
1862
- iframe.contentWindow.document.close();
1863
- // Create and add exported image
1864
- var img = new Image();
1865
- img.src = data;
1866
- img.style.maxWidth = "100%";
1867
- img.style.height = "auto";
1868
- if (title) {
1869
- iframe.contentWindow.document.title = title;
1407
+ }
1408
+ _printViaCSS(data, customOptions, title) {
1409
+ const options = this._getFormatOptions("print", customOptions);
1410
+ let delay = options.delay || 500;
1411
+ //Save current scroll position
1412
+ let scroll = document.documentElement.scrollTop || document.body.scrollTop;
1413
+ // Hide all document nodes by applyin custom CSS
1414
+ let rule = new StyleRule($utils.getShadowRoot(this._root.dom), "body > *", {
1415
+ "display": "none",
1416
+ "position": "fixed",
1417
+ "visibility": "hidden",
1418
+ "opacity": "0",
1419
+ "clipPath": "polygon(0px 0px,0px 0px,0px 0px,0px 0px);"
1420
+ }, this._root.nonce);
1421
+ // Replace title?
1422
+ let originalTitle;
1423
+ if (title && document && document.title) {
1424
+ originalTitle = document.title;
1425
+ document.title = title;
1426
+ }
1427
+ // Create and add exported image
1428
+ let img = new Image();
1429
+ img.src = data;
1430
+ img.style.maxWidth = "100%";
1431
+ img.style.display = "block";
1432
+ img.style.position = "relative";
1433
+ img.style.visibility = "visible";
1434
+ img.style.opacity = "1";
1435
+ img.style.clipPath = "none";
1436
+ document.body.appendChild(img);
1437
+ // Print
1438
+ this.setTimeout(() => {
1439
+ window.print();
1440
+ }, 50);
1441
+ // Delay needs to be at least a second for iOS devices
1442
+ let isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
1443
+ if (isIOS && (delay < 1000)) {
1444
+ delay = 1000;
1445
+ }
1446
+ else if (delay < 100) {
1447
+ delay = 100;
1448
+ }
1449
+ // Delay function that resets back the document the way ot was before
1450
+ this.setTimeout(() => {
1451
+ // Remove image
1452
+ document.body.removeChild(img);
1453
+ // Reset back all elements
1454
+ /*for (let len = items.length, i = 0; i < len; i++) {
1455
+ let item = <HTMLElement>items[i];
1456
+ if ($dom.isElement(item)) {
1457
+ item.style.display = states[i];
1458
+ }
1459
+ }*/
1460
+ rule.dispose();
1461
+ // Restore title
1462
+ if (originalTitle) {
1463
+ document.title = document.title;
1870
1464
  }
1465
+ // Scroll back the document the way it was before
1466
+ document.documentElement.scrollTop = document.body.scrollTop = scroll;
1467
+ }, delay || 500);
1468
+ }
1469
+ _printViaIframe(data, customOptions, title) {
1470
+ const options = this._getFormatOptions("print", customOptions);
1471
+ let delay = options.delay || 500;
1472
+ // Create an iframe
1473
+ const iframe = document.createElement("iframe");
1474
+ iframe.style.visibility = "hidden";
1475
+ document.body.appendChild(iframe);
1476
+ // This is needed for FireFox
1477
+ iframe.contentWindow.document.open();
1478
+ iframe.contentWindow.document.close();
1479
+ // Create and add exported image
1480
+ let img = new Image();
1481
+ img.src = data;
1482
+ img.style.maxWidth = "100%";
1483
+ img.style.height = "auto";
1484
+ if (title) {
1485
+ iframe.contentWindow.document.title = title;
1486
+ }
1487
+ iframe.contentWindow.document.body.appendChild(img);
1488
+ iframe.load = function () {
1871
1489
  iframe.contentWindow.document.body.appendChild(img);
1872
- iframe.load = function () {
1873
- iframe.contentWindow.document.body.appendChild(img);
1874
- };
1875
- // Print
1876
- this.setTimeout(function () {
1877
- try {
1878
- if (!iframe.contentWindow.document.execCommand("print", false, null)) {
1879
- iframe.contentWindow.print();
1880
- }
1881
- }
1882
- catch (e) {
1490
+ };
1491
+ // Print
1492
+ this.setTimeout(() => {
1493
+ try {
1494
+ if (!iframe.contentWindow.document.execCommand("print", false, null)) {
1883
1495
  iframe.contentWindow.print();
1884
1496
  }
1885
- }, delay || 50);
1886
- // Delay needs to be at least a second for iOS devices
1887
- var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
1888
- if (isIOS && (delay < 1000)) {
1889
- delay = 1000;
1890
1497
  }
1891
- else if (delay < 100) {
1892
- delay = 100;
1498
+ catch (e) {
1499
+ iframe.contentWindow.print();
1893
1500
  }
1894
- // Delay function that resets back the document the way ot was before
1895
- this.setTimeout(function () {
1896
- // Remove image
1897
- document.body.removeChild(iframe);
1898
- }, delay + 50 || 100);
1501
+ }, delay || 50);
1502
+ // Delay needs to be at least a second for iOS devices
1503
+ let isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
1504
+ if (isIOS && (delay < 1000)) {
1505
+ delay = 1000;
1899
1506
  }
1900
- });
1507
+ else if (delay < 100) {
1508
+ delay = 100;
1509
+ }
1510
+ // Delay function that resets back the document the way ot was before
1511
+ this.setTimeout(() => {
1512
+ // Remove image
1513
+ document.body.removeChild(iframe);
1514
+ }, delay + 50 || 100);
1515
+ }
1901
1516
  /**
1902
1517
  * Returns a list of formats that can be exported in current browser.
1903
1518
  *
1904
1519
  * @return Formats
1905
1520
  */
1906
- Object.defineProperty(Exporting.prototype, "supportedFormats", {
1907
- enumerable: false,
1908
- configurable: true,
1909
- writable: true,
1910
- value: function () {
1911
- var _this = this;
1912
- var res = [];
1913
- var hasData = this.hasData();
1914
- var downloadSupport = this.downloadSupport();
1915
- $array.each(["png", "jpg", "canvas", "pdf", "xlsx", "csv", "json", "html", "pdfdata", "print"], function (format) {
1916
- var options = _this._getFormatOptions(format);
1917
- if (options.disabled !== true) {
1918
- if (["xlsx", "csv", "json", "html", "pdfdata"].indexOf(format) == -1 || (hasData && downloadSupport)) {
1919
- res.push(format);
1920
- }
1521
+ supportedFormats() {
1522
+ const res = [];
1523
+ const hasData = this.hasData();
1524
+ const downloadSupport = this.downloadSupport();
1525
+ $array.each(["png", "jpg", "canvas", "pdf", "xlsx", "csv", "json", "html", "pdfdata", "print"], (format) => {
1526
+ const options = this._getFormatOptions(format);
1527
+ if (options.disabled !== true) {
1528
+ if (["xlsx", "csv", "json", "html", "pdfdata"].indexOf(format) == -1 || (hasData && downloadSupport)) {
1529
+ res.push(format);
1921
1530
  }
1922
- });
1923
- return res;
1924
- }
1925
- });
1531
+ }
1532
+ });
1533
+ return res;
1534
+ }
1926
1535
  /**
1927
1536
  * Returns a list of supported export types: image or print.
1928
1537
  *
1929
1538
  * @return Supported types
1930
1539
  */
1931
- Object.defineProperty(Exporting.prototype, "supportedExportTypes", {
1932
- enumerable: false,
1933
- configurable: true,
1934
- writable: true,
1935
- value: function () {
1936
- var res = ["image", "print"];
1937
- if (this.downloadSupport() && this.hasData()) {
1938
- res.push("data");
1939
- }
1940
- return res;
1540
+ supportedExportTypes() {
1541
+ const res = ["image", "print"];
1542
+ if (this.downloadSupport() && this.hasData()) {
1543
+ res.push("data");
1941
1544
  }
1942
- });
1943
- Object.defineProperty(Exporting, "className", {
1944
- enumerable: true,
1945
- configurable: true,
1946
- writable: true,
1947
- value: "Exporting"
1948
- });
1949
- Object.defineProperty(Exporting, "classNames", {
1950
- enumerable: true,
1951
- configurable: true,
1952
- writable: true,
1953
- value: Entity.classNames.concat([Exporting.className])
1954
- });
1955
- return Exporting;
1956
- }(Entity));
1957
- export { Exporting };
1545
+ return res;
1546
+ }
1547
+ }
1548
+ Object.defineProperty(Exporting, "className", {
1549
+ enumerable: true,
1550
+ configurable: true,
1551
+ writable: true,
1552
+ value: "Exporting"
1553
+ });
1554
+ Object.defineProperty(Exporting, "classNames", {
1555
+ enumerable: true,
1556
+ configurable: true,
1557
+ writable: true,
1558
+ value: Entity.classNames.concat([Exporting.className])
1559
+ });
1958
1560
  //# sourceMappingURL=Exporting.js.map