victory-core 36.4.0 → 36.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (368) hide show
  1. package/dist/victory-core.js +45735 -12154
  2. package/dist/victory-core.min.js +2 -1
  3. package/dist/victory-core.min.js.LICENSE.txt +19 -0
  4. package/es/index.d.ts +18 -941
  5. package/es/index.js +18 -73
  6. package/es/types/callbacks.d.ts +37 -0
  7. package/es/types/callbacks.js +2 -0
  8. package/es/types/prop-types.d.ts +130 -0
  9. package/es/types/prop-types.js +2 -0
  10. package/es/victory-accessible-group/victory-accessible-group.d.ts +26 -0
  11. package/es/victory-accessible-group/victory-accessible-group.js +9 -16
  12. package/es/victory-animation/util.d.ts +67 -0
  13. package/es/victory-animation/util.js +7 -4
  14. package/es/victory-animation/victory-animation.d.ts +70 -0
  15. package/es/victory-animation/victory-animation.js +60 -67
  16. package/es/victory-clip-container/victory-clip-container.d.ts +77 -0
  17. package/es/victory-clip-container/victory-clip-container.js +19 -23
  18. package/es/victory-container/victory-container.d.ts +100 -0
  19. package/es/victory-container/victory-container.js +32 -31
  20. package/es/victory-label/victory-label.d.ts +62 -0
  21. package/es/victory-label/victory-label.js +17 -10
  22. package/es/victory-portal/portal-context.d.ts +12 -0
  23. package/es/victory-portal/portal-context.js +3 -3
  24. package/es/victory-portal/portal.d.ts +29 -0
  25. package/es/victory-portal/portal.js +26 -33
  26. package/es/victory-portal/victory-portal.d.ts +32 -0
  27. package/es/victory-portal/victory-portal.js +24 -22
  28. package/es/victory-primitives/arc.d.ts +50 -0
  29. package/es/victory-primitives/arc.js +4 -5
  30. package/es/victory-primitives/background.d.ts +51 -0
  31. package/es/victory-primitives/background.js +5 -6
  32. package/es/victory-primitives/border.d.ts +44 -0
  33. package/es/victory-primitives/border.js +4 -5
  34. package/es/victory-primitives/circle.d.ts +3 -0
  35. package/es/victory-primitives/circle.js +11 -7
  36. package/es/victory-primitives/clip-path.d.ts +15 -0
  37. package/es/victory-primitives/clip-path.js +6 -5
  38. package/es/victory-primitives/index.d.ts +15 -0
  39. package/es/victory-primitives/index.js +15 -0
  40. package/es/victory-primitives/line-segment.d.ts +46 -0
  41. package/es/victory-primitives/line-segment.js +4 -5
  42. package/es/victory-primitives/line.d.ts +3 -0
  43. package/es/victory-primitives/line.js +11 -7
  44. package/es/victory-primitives/path.d.ts +3 -0
  45. package/es/victory-primitives/path.js +9 -5
  46. package/es/victory-primitives/point.d.ts +49 -0
  47. package/es/victory-primitives/point.js +10 -19
  48. package/es/victory-primitives/rect.d.ts +3 -0
  49. package/es/victory-primitives/rect.js +11 -7
  50. package/es/victory-primitives/text.d.ts +17 -0
  51. package/es/victory-primitives/text.js +7 -5
  52. package/es/victory-primitives/tspan.d.ts +3 -0
  53. package/es/victory-primitives/tspan.js +7 -5
  54. package/es/victory-primitives/types.d.ts +8 -0
  55. package/es/victory-primitives/types.js +2 -0
  56. package/es/victory-primitives/whisker.d.ts +59 -0
  57. package/es/victory-primitives/whisker.js +4 -5
  58. package/es/victory-state/defaults.d.ts +3 -0
  59. package/es/victory-state/defaults.js +3 -0
  60. package/es/victory-state/helpers/get-axis-data.d.ts +3 -0
  61. package/es/victory-state/helpers/get-axis-data.js +15 -0
  62. package/es/victory-state/helpers/get-data.d.ts +15 -0
  63. package/es/victory-state/helpers/get-data.js +88 -0
  64. package/es/victory-state/helpers/get-domain.d.ts +6 -0
  65. package/es/victory-state/helpers/get-domain.js +68 -0
  66. package/es/victory-state/helpers/get-range.d.ts +6 -0
  67. package/es/victory-state/helpers/get-range.js +37 -0
  68. package/es/victory-state/helpers/get-scale.d.ts +6 -0
  69. package/es/victory-state/helpers/get-scale.js +59 -0
  70. package/es/victory-state/index.d.ts +3 -0
  71. package/es/victory-state/index.js +3 -0
  72. package/es/victory-state/types.d.ts +24 -0
  73. package/es/victory-state/types.js +2 -0
  74. package/es/victory-state/victory-provider.d.ts +19 -0
  75. package/es/victory-state/victory-provider.js +118 -0
  76. package/es/victory-theme/grayscale.d.ts +3 -0
  77. package/es/victory-theme/grayscale.js +3 -2
  78. package/es/victory-theme/material.d.ts +3 -0
  79. package/es/victory-theme/material.js +3 -2
  80. package/es/victory-theme/types.d.ts +239 -0
  81. package/es/victory-theme/types.js +2 -0
  82. package/es/victory-theme/victory-theme.d.ts +6 -0
  83. package/es/victory-theme/victory-theme.js +8 -6
  84. package/es/victory-transition/victory-transition.d.ts +60 -0
  85. package/es/victory-transition/victory-transition.js +20 -23
  86. package/es/victory-util/add-events.d.ts +106 -0
  87. package/es/victory-util/add-events.js +45 -38
  88. package/es/victory-util/axis.d.ts +51 -0
  89. package/es/victory-util/axis.js +9 -8
  90. package/es/victory-util/collection.d.ts +9 -0
  91. package/es/victory-util/collection.js +6 -6
  92. package/es/victory-util/common-props.d.ts +84 -0
  93. package/es/victory-util/common-props.js +31 -14
  94. package/es/victory-util/data.d.ts +75 -0
  95. package/es/victory-util/data.js +2 -3
  96. package/es/victory-util/default-transitions.d.ts +5 -0
  97. package/es/victory-util/default-transitions.js +2 -2
  98. package/es/victory-util/domain.d.ts +91 -0
  99. package/es/victory-util/domain.js +6 -4
  100. package/es/victory-util/events.d.ts +65 -0
  101. package/es/victory-util/events.js +13 -8
  102. package/es/victory-util/helpers.d.ts +61 -0
  103. package/es/victory-util/helpers.js +8 -6
  104. package/es/victory-util/hooks/index.d.ts +3 -0
  105. package/es/victory-util/hooks/index.js +2 -1
  106. package/es/victory-util/hooks/use-animation-state.js +2 -1
  107. package/es/victory-util/hooks/use-previous-props.d.ts +2 -0
  108. package/es/victory-util/hooks/use-previous-props.js +4 -3
  109. package/es/victory-util/immutable.d.ts +12 -0
  110. package/es/victory-util/immutable.js +5 -5
  111. package/es/victory-util/index.d.ts +29 -0
  112. package/es/victory-util/index.js +48 -0
  113. package/es/victory-util/label-helpers.d.ts +27 -0
  114. package/es/victory-util/label-helpers.js +2 -3
  115. package/es/victory-util/line-helpers.d.ts +5 -0
  116. package/es/victory-util/line-helpers.js +24 -6
  117. package/es/victory-util/log.d.ts +2 -0
  118. package/es/victory-util/log.js +2 -2
  119. package/es/victory-util/point-path-helpers.d.ts +10 -0
  120. package/es/victory-util/point-path-helpers.js +60 -61
  121. package/es/victory-util/prop-types.d.ts +51 -0
  122. package/es/victory-util/prop-types.js +35 -44
  123. package/es/victory-util/scale.d.ts +10 -0
  124. package/es/victory-util/scale.js +14 -6
  125. package/es/victory-util/selection.d.ts +25 -0
  126. package/es/victory-util/selection.js +25 -16
  127. package/es/victory-util/style.d.ts +19 -0
  128. package/es/victory-util/style.js +2 -3
  129. package/es/victory-util/textsize.d.ts +37 -0
  130. package/es/victory-util/textsize.js +9 -6
  131. package/es/victory-util/timer-context.d.ts +12 -0
  132. package/es/victory-util/timer-context.js +2 -1
  133. package/es/victory-util/timer.d.ts +17 -0
  134. package/es/victory-util/timer.js +15 -9
  135. package/es/victory-util/transitions.d.ts +49 -0
  136. package/es/victory-util/transitions.js +5 -4
  137. package/es/victory-util/type-helpers.d.ts +10 -0
  138. package/es/victory-util/type-helpers.js +28 -0
  139. package/es/victory-util/user-props.d.ts +21 -0
  140. package/es/victory-util/user-props.js +17 -3
  141. package/es/victory-util/with-container.d.ts +5 -0
  142. package/es/victory-util/with-container.js +32 -0
  143. package/es/victory-util/wrapper.d.ts +38 -0
  144. package/es/victory-util/wrapper.js +4 -3
  145. package/lib/index.d.ts +18 -941
  146. package/lib/index.js +224 -311
  147. package/lib/types/callbacks.d.ts +37 -0
  148. package/lib/types/callbacks.js +2 -0
  149. package/lib/types/prop-types.d.ts +130 -0
  150. package/lib/types/prop-types.js +2 -0
  151. package/lib/victory-accessible-group/victory-accessible-group.d.ts +26 -0
  152. package/lib/victory-accessible-group/victory-accessible-group.js +10 -15
  153. package/lib/victory-animation/util.d.ts +67 -0
  154. package/lib/victory-animation/util.js +7 -4
  155. package/lib/victory-animation/victory-animation.d.ts +70 -0
  156. package/lib/victory-animation/victory-animation.js +61 -65
  157. package/lib/victory-clip-container/victory-clip-container.d.ts +77 -0
  158. package/lib/victory-clip-container/victory-clip-container.js +24 -24
  159. package/lib/victory-container/victory-container.d.ts +100 -0
  160. package/lib/victory-container/victory-container.js +35 -31
  161. package/lib/victory-label/victory-label.d.ts +62 -0
  162. package/lib/victory-label/victory-label.js +24 -15
  163. package/lib/victory-portal/portal-context.d.ts +12 -0
  164. package/lib/victory-portal/portal-context.js +3 -3
  165. package/lib/victory-portal/portal.d.ts +29 -0
  166. package/lib/victory-portal/portal.js +27 -31
  167. package/lib/victory-portal/victory-portal.d.ts +32 -0
  168. package/lib/victory-portal/victory-portal.js +25 -20
  169. package/lib/victory-primitives/arc.d.ts +50 -0
  170. package/lib/victory-primitives/arc.js +7 -7
  171. package/lib/victory-primitives/background.d.ts +51 -0
  172. package/lib/victory-primitives/background.js +9 -9
  173. package/lib/victory-primitives/border.d.ts +44 -0
  174. package/lib/victory-primitives/border.js +7 -7
  175. package/lib/victory-primitives/circle.d.ts +3 -0
  176. package/lib/victory-primitives/circle.js +12 -6
  177. package/lib/victory-primitives/clip-path.d.ts +15 -0
  178. package/lib/victory-primitives/clip-path.js +7 -4
  179. package/lib/victory-primitives/index.d.ts +15 -0
  180. package/lib/victory-primitives/index.js +188 -0
  181. package/lib/victory-primitives/line-segment.d.ts +46 -0
  182. package/lib/victory-primitives/line-segment.js +7 -7
  183. package/lib/victory-primitives/line.d.ts +3 -0
  184. package/lib/victory-primitives/line.js +12 -6
  185. package/lib/victory-primitives/path.d.ts +3 -0
  186. package/lib/victory-primitives/path.js +10 -4
  187. package/lib/victory-primitives/point.d.ts +49 -0
  188. package/lib/victory-primitives/point.js +15 -22
  189. package/lib/victory-primitives/rect.d.ts +3 -0
  190. package/lib/victory-primitives/rect.js +12 -6
  191. package/lib/victory-primitives/text.d.ts +17 -0
  192. package/lib/victory-primitives/text.js +8 -4
  193. package/lib/victory-primitives/tspan.d.ts +3 -0
  194. package/lib/victory-primitives/tspan.js +8 -4
  195. package/lib/victory-primitives/types.d.ts +8 -0
  196. package/lib/victory-primitives/types.js +2 -0
  197. package/lib/victory-primitives/whisker.d.ts +59 -0
  198. package/lib/victory-primitives/whisker.js +7 -7
  199. package/lib/victory-state/defaults.d.ts +3 -0
  200. package/lib/victory-state/defaults.js +11 -0
  201. package/lib/victory-state/helpers/get-axis-data.d.ts +3 -0
  202. package/lib/victory-state/helpers/get-axis-data.js +23 -0
  203. package/lib/victory-state/helpers/get-data.d.ts +15 -0
  204. package/lib/victory-state/helpers/get-data.js +99 -0
  205. package/lib/victory-state/helpers/get-domain.d.ts +6 -0
  206. package/lib/victory-state/helpers/get-domain.js +82 -0
  207. package/lib/victory-state/helpers/get-range.d.ts +6 -0
  208. package/lib/victory-state/helpers/get-range.js +46 -0
  209. package/lib/victory-state/helpers/get-scale.d.ts +6 -0
  210. package/lib/victory-state/helpers/get-scale.js +74 -0
  211. package/lib/victory-state/index.d.ts +3 -0
  212. package/lib/victory-state/index.js +32 -0
  213. package/lib/victory-state/types.d.ts +24 -0
  214. package/lib/victory-state/types.js +2 -0
  215. package/lib/victory-state/victory-provider.d.ts +19 -0
  216. package/lib/victory-state/victory-provider.js +146 -0
  217. package/lib/victory-theme/grayscale.d.ts +3 -0
  218. package/lib/victory-theme/grayscale.js +4 -3
  219. package/lib/victory-theme/material.d.ts +3 -0
  220. package/lib/victory-theme/material.js +4 -3
  221. package/lib/victory-theme/types.d.ts +239 -0
  222. package/lib/victory-theme/types.js +2 -0
  223. package/lib/victory-theme/victory-theme.d.ts +6 -0
  224. package/lib/victory-theme/victory-theme.js +23 -8
  225. package/lib/victory-transition/victory-transition.d.ts +60 -0
  226. package/lib/victory-transition/victory-transition.js +22 -23
  227. package/lib/victory-util/add-events.d.ts +106 -0
  228. package/lib/victory-util/add-events.js +49 -47
  229. package/lib/victory-util/axis.d.ts +51 -0
  230. package/lib/victory-util/axis.js +8 -6
  231. package/lib/victory-util/collection.d.ts +9 -0
  232. package/lib/victory-util/collection.js +6 -6
  233. package/lib/victory-util/common-props.d.ts +84 -0
  234. package/lib/victory-util/common-props.js +29 -14
  235. package/lib/victory-util/data.d.ts +75 -0
  236. package/lib/victory-util/data.js +2 -1
  237. package/lib/victory-util/default-transitions.d.ts +5 -0
  238. package/lib/victory-util/default-transitions.js +2 -2
  239. package/lib/victory-util/domain.d.ts +91 -0
  240. package/lib/victory-util/domain.js +6 -2
  241. package/lib/victory-util/events.d.ts +65 -0
  242. package/lib/victory-util/events.js +13 -9
  243. package/lib/victory-util/helpers.d.ts +61 -0
  244. package/lib/victory-util/helpers.js +8 -6
  245. package/lib/victory-util/hooks/index.d.ts +3 -0
  246. package/lib/victory-util/hooks/index.js +2 -1
  247. package/lib/victory-util/hooks/use-animation-state.js +2 -1
  248. package/lib/victory-util/hooks/use-previous-props.d.ts +2 -0
  249. package/lib/victory-util/hooks/use-previous-props.js +5 -6
  250. package/lib/victory-util/immutable.d.ts +12 -0
  251. package/lib/victory-util/immutable.js +5 -6
  252. package/lib/victory-util/index.d.ts +29 -0
  253. package/lib/victory-util/index.js +181 -0
  254. package/lib/victory-util/label-helpers.d.ts +27 -0
  255. package/lib/victory-util/label-helpers.js +2 -3
  256. package/lib/victory-util/line-helpers.d.ts +5 -0
  257. package/lib/victory-util/line-helpers.js +28 -7
  258. package/lib/victory-util/log.d.ts +2 -0
  259. package/lib/victory-util/log.js +2 -2
  260. package/lib/victory-util/point-path-helpers.d.ts +10 -0
  261. package/lib/victory-util/point-path-helpers.js +87 -73
  262. package/lib/victory-util/prop-types.d.ts +51 -0
  263. package/lib/victory-util/prop-types.js +36 -44
  264. package/lib/victory-util/scale.d.ts +10 -0
  265. package/lib/victory-util/scale.js +14 -5
  266. package/lib/victory-util/selection.d.ts +25 -0
  267. package/lib/victory-util/selection.js +25 -21
  268. package/lib/victory-util/style.d.ts +19 -0
  269. package/lib/victory-util/style.js +2 -3
  270. package/lib/victory-util/textsize.d.ts +37 -0
  271. package/lib/victory-util/textsize.js +9 -6
  272. package/lib/victory-util/timer-context.d.ts +12 -0
  273. package/lib/victory-util/timer-context.js +2 -1
  274. package/lib/victory-util/timer.d.ts +17 -0
  275. package/lib/victory-util/timer.js +15 -9
  276. package/lib/victory-util/transitions.d.ts +49 -0
  277. package/lib/victory-util/transitions.js +5 -4
  278. package/lib/victory-util/type-helpers.d.ts +10 -0
  279. package/lib/victory-util/type-helpers.js +45 -0
  280. package/lib/victory-util/user-props.d.ts +21 -0
  281. package/lib/victory-util/user-props.js +25 -4
  282. package/lib/victory-util/with-container.d.ts +5 -0
  283. package/lib/victory-util/with-container.js +44 -0
  284. package/lib/victory-util/wrapper.d.ts +38 -0
  285. package/lib/victory-util/wrapper.js +4 -3
  286. package/package.json +6 -6
  287. package/src/index.ts +17 -0
  288. package/src/types/callbacks.ts +53 -0
  289. package/src/types/prop-types.ts +195 -0
  290. package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +13 -6
  291. package/src/victory-animation/{util.js → util.ts} +6 -4
  292. package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +100 -23
  293. package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +55 -29
  294. package/src/victory-container/{victory-container.js → victory-container.tsx} +86 -42
  295. package/src/victory-label/{victory-label.js → victory-label.tsx} +112 -49
  296. package/src/victory-portal/portal-context.ts +14 -0
  297. package/src/victory-portal/{portal.js → portal.tsx} +24 -13
  298. package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +24 -9
  299. package/src/victory-primitives/{arc.js → arc.tsx} +22 -10
  300. package/src/victory-primitives/{background.js → background.tsx} +24 -12
  301. package/src/victory-primitives/{border.js → border.tsx} +19 -10
  302. package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
  303. package/src/victory-primitives/clip-path.tsx +25 -0
  304. package/src/victory-primitives/index.ts +14 -0
  305. package/src/victory-primitives/{line-segment.js → line-segment.tsx} +20 -10
  306. package/src/victory-primitives/{line.js → line.tsx} +4 -3
  307. package/src/victory-primitives/{path.js → path.tsx} +4 -3
  308. package/src/victory-primitives/{point.js → point.tsx} +33 -26
  309. package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
  310. package/src/victory-primitives/{text.js → text.tsx} +10 -4
  311. package/src/victory-primitives/tspan.tsx +7 -0
  312. package/src/victory-primitives/types.ts +19 -0
  313. package/src/victory-primitives/{whisker.js → whisker.tsx} +34 -19
  314. package/src/victory-state/defaults.ts +2 -0
  315. package/src/victory-state/helpers/get-axis-data.ts +14 -0
  316. package/src/victory-state/helpers/get-data.ts +79 -0
  317. package/src/victory-state/helpers/get-domain.ts +62 -0
  318. package/src/victory-state/helpers/get-range.ts +39 -0
  319. package/src/victory-state/helpers/get-scale.ts +64 -0
  320. package/src/victory-state/index.ts +2 -0
  321. package/src/victory-state/types.ts +32 -0
  322. package/src/victory-state/victory-provider.tsx +121 -0
  323. package/src/victory-theme/{grayscale.js → grayscale.tsx} +63 -62
  324. package/src/victory-theme/{material.js → material.tsx} +68 -67
  325. package/src/victory-theme/types.ts +257 -0
  326. package/src/victory-theme/victory-theme.tsx +5 -0
  327. package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +82 -33
  328. package/src/victory-util/{add-events.js → add-events.tsx} +143 -64
  329. package/src/victory-util/{axis.js → axis.tsx} +17 -19
  330. package/src/victory-util/{collection.js → collection.tsx} +14 -11
  331. package/src/victory-util/common-props.tsx +307 -0
  332. package/src/victory-util/{data.js → data.ts} +14 -11
  333. package/src/victory-util/{default-transitions.js → default-transitions.ts} +20 -19
  334. package/src/victory-util/{domain.js → domain.ts} +26 -24
  335. package/src/victory-util/{events.js → events.ts} +83 -32
  336. package/src/victory-util/{helpers.js → helpers.ts} +41 -23
  337. package/src/victory-util/hooks/{index.js → index.ts} +0 -0
  338. package/src/victory-util/hooks/use-animation-state.js +10 -10
  339. package/src/victory-util/hooks/use-previous-props.ts +9 -0
  340. package/src/victory-util/{immutable.js → immutable.ts} +14 -11
  341. package/src/victory-util/index.ts +28 -0
  342. package/src/victory-util/{label-helpers.js → label-helpers.ts} +7 -8
  343. package/src/victory-util/line-helpers.ts +104 -0
  344. package/src/victory-util/{log.js → log.ts} +1 -2
  345. package/src/victory-util/point-path-helpers.ts +119 -0
  346. package/src/victory-util/{prop-types.js → prop-types.ts} +103 -102
  347. package/src/victory-util/{scale.js → scale.ts} +29 -17
  348. package/src/victory-util/selection.ts +158 -0
  349. package/src/victory-util/{style.js → style.ts} +3 -4
  350. package/src/victory-util/{textsize.js → textsize.ts} +32 -17
  351. package/src/victory-util/{timer-context.js → timer-context.ts} +1 -1
  352. package/src/victory-util/{timer.js → timer.ts} +16 -6
  353. package/src/victory-util/{transitions.js → transitions.ts} +50 -23
  354. package/src/victory-util/type-helpers.ts +50 -0
  355. package/src/victory-util/{user-props.js → user-props.ts} +26 -8
  356. package/src/victory-util/with-container.tsx +41 -0
  357. package/src/victory-util/{wrapper.js → wrapper.tsx} +38 -34
  358. package/src/index.d.ts +0 -941
  359. package/src/index.js +0 -51
  360. package/src/victory-portal/portal-context.js +0 -10
  361. package/src/victory-primitives/clip-path.js +0 -18
  362. package/src/victory-primitives/tspan.js +0 -5
  363. package/src/victory-theme/victory-theme.js +0 -7
  364. package/src/victory-util/common-props.js +0 -197
  365. package/src/victory-util/hooks/use-previous-props.js +0 -9
  366. package/src/victory-util/line-helpers.js +0 -54
  367. package/src/victory-util/point-path-helpers.js +0 -121
  368. package/src/victory-util/selection.js +0 -99
@@ -18,7 +18,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
18
18
 
19
19
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
20
20
 
21
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
21
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
22
 
23
23
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
24
24
 
@@ -28,9 +28,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
28
28
 
29
29
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
30
30
 
31
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
-
33
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
34
32
 
35
33
  /*global setTimeout:false */
36
34
  import React from "react";
@@ -39,8 +37,7 @@ import * as d3Ease from "victory-vendor/d3-ease";
39
37
  import { victoryInterpolator } from "./util";
40
38
  import TimerContext from "../victory-util/timer-context";
41
39
  import isEqual from "react-fast-compare";
42
-
43
- var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
40
+ export var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
44
41
  _inherits(VictoryAnimation, _React$Component);
45
42
 
46
43
  var _super = _createSuper(VictoryAnimation);
@@ -53,6 +50,56 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
53
50
  _this = _super.call(this, props, context);
54
51
  /* defaults */
55
52
 
53
+ _this.interpolator = void 0;
54
+ _this.queue = void 0;
55
+ _this.ease = void 0;
56
+ _this.timer = void 0;
57
+ _this.loopID = void 0;
58
+
59
+ _this.functionToBeRunEachFrame = function (elapsed, duration) {
60
+ /*
61
+ step can generate imprecise values, sometimes greater than 1
62
+ if this happens set the state to 1 and return, cancelling the timer
63
+ */
64
+ duration = duration !== undefined ? duration : _this.props.duration;
65
+ var step = duration ? elapsed / duration : 1;
66
+
67
+ if (step >= 1) {
68
+ _this.setState({
69
+ data: _this.interpolator(1),
70
+ animationInfo: {
71
+ progress: 1,
72
+ animating: false,
73
+ terminating: true
74
+ }
75
+ });
76
+
77
+ if (_this.loopID) {
78
+ _this.timer.unsubscribe(_this.loopID);
79
+ }
80
+
81
+ _this.queue.shift();
82
+
83
+ _this.traverseQueue();
84
+
85
+ return;
86
+ }
87
+ /*
88
+ if we're not at the end of the timer, set the state by passing
89
+ current step value that's transformed by the ease function to the
90
+ interpolator, which is cached for performance whenever props are received
91
+ */
92
+
93
+
94
+ _this.setState({
95
+ data: _this.interpolator(_this.ease(step)),
96
+ animationInfo: {
97
+ progress: step,
98
+ animating: step < 1
99
+ }
100
+ });
101
+ };
102
+
56
103
  _this.state = {
57
104
  data: Array.isArray(_this.props.data) ? _this.props.data[0] : _this.props.data,
58
105
  animationInfo: {
@@ -65,12 +112,6 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
65
112
  /* build easing function */
66
113
 
67
114
  _this.ease = d3Ease[_this.toNewName(_this.props.easing)];
68
- /*
69
- There is no autobinding of this in ES6 classes
70
- so we bind functionToBeRunEachFrame to current instance of victory animation class
71
- */
72
-
73
- _this.functionToBeRunEachFrame = _this.functionToBeRunEachFrame.bind(_assertThisInitialized(_this));
74
115
  _this.timer = _this.context.animationTimer;
75
116
  return _this;
76
117
  }
@@ -171,49 +212,6 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
171
212
  }
172
213
  /* every frame we... */
173
214
 
174
- }, {
175
- key: "functionToBeRunEachFrame",
176
- value: function functionToBeRunEachFrame(elapsed, duration) {
177
- /*
178
- step can generate imprecise values, sometimes greater than 1
179
- if this happens set the state to 1 and return, cancelling the timer
180
- */
181
- duration = duration !== undefined ? duration : this.props.duration;
182
- var step = duration ? elapsed / duration : 1;
183
-
184
- if (step >= 1) {
185
- this.setState({
186
- data: this.interpolator(1),
187
- animationInfo: {
188
- progress: 1,
189
- animating: false,
190
- terminating: true
191
- }
192
- });
193
-
194
- if (this.loopID) {
195
- this.timer.unsubscribe(this.loopID);
196
- }
197
-
198
- this.queue.shift();
199
- this.traverseQueue();
200
- return;
201
- }
202
- /*
203
- if we're not at the end of the timer, set the state by passing
204
- current step value that's transformed by the ease function to the
205
- interpolator, which is cached for performance whenever props are received
206
- */
207
-
208
-
209
- this.setState({
210
- data: this.interpolator(this.ease(step)),
211
- animationInfo: {
212
- progress: step,
213
- animating: step < 1
214
- }
215
- });
216
- }
217
215
  }, {
218
216
  key: "render",
219
217
  value: function render() {
@@ -223,25 +221,20 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
223
221
 
224
222
  return VictoryAnimation;
225
223
  }(React.Component);
226
-
227
- _defineProperty(VictoryAnimation, "displayName", "VictoryAnimation");
228
-
229
- _defineProperty(VictoryAnimation, "propTypes", {
224
+ VictoryAnimation.displayName = "VictoryAnimation";
225
+ VictoryAnimation.propTypes = {
230
226
  children: PropTypes.func,
231
227
  data: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
232
228
  delay: PropTypes.number,
233
229
  duration: PropTypes.number,
234
230
  easing: PropTypes.oneOf(["back", "backIn", "backOut", "backInOut", "bounce", "bounceIn", "bounceOut", "bounceInOut", "circle", "circleIn", "circleOut", "circleInOut", "linear", "linearIn", "linearOut", "linearInOut", "cubic", "cubicIn", "cubicOut", "cubicInOut", "elastic", "elasticIn", "elasticOut", "elasticInOut", "exp", "expIn", "expOut", "expInOut", "poly", "polyIn", "polyOut", "polyInOut", "quad", "quadIn", "quadOut", "quadInOut", "sin", "sinIn", "sinOut", "sinInOut"]),
235
231
  onEnd: PropTypes.func
236
- });
237
-
238
- _defineProperty(VictoryAnimation, "defaultProps", {
232
+ };
233
+ VictoryAnimation.defaultProps = {
239
234
  data: {},
240
235
  delay: 0,
241
236
  duration: 1000,
242
237
  easing: "quadInOut"
243
- });
244
-
245
- _defineProperty(VictoryAnimation, "contextType", TimerContext);
246
-
247
- export { VictoryAnimation as default };
238
+ };
239
+ VictoryAnimation.contextType = TimerContext;
240
+ //# sourceMappingURL=victory-animation.js.map
@@ -0,0 +1,77 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import { BlockProps } from "../victory-theme/victory-theme";
4
+ import { OriginType } from "../victory-label/victory-label";
5
+ export interface VictoryClipContainerProps {
6
+ "aria-label"?: string;
7
+ children?: React.ReactElement | React.ReactElement[];
8
+ circleComponent?: React.ReactElement;
9
+ className?: string;
10
+ clipHeight?: number;
11
+ clipId?: number | string;
12
+ clipPadding?: BlockProps;
13
+ clipPathComponent?: React.ReactElement;
14
+ clipWidth?: number;
15
+ events?: React.DOMAttributes<any>;
16
+ groupComponent?: React.ReactElement;
17
+ origin?: OriginType;
18
+ polar?: boolean;
19
+ radius?: number;
20
+ rectComponent?: React.ReactElement;
21
+ translateX?: number;
22
+ translateY?: number;
23
+ }
24
+ export declare class VictoryClipContainer extends React.Component<VictoryClipContainerProps> {
25
+ static displayName: string;
26
+ static role: string;
27
+ static propTypes: {
28
+ "aria-label": PropTypes.Requireable<string>;
29
+ children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
30
+ circleComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
31
+ className: PropTypes.Requireable<string>;
32
+ clipHeight: PropTypes.Requireable<number | undefined>;
33
+ clipId: PropTypes.Requireable<string | number>;
34
+ clipPadding: PropTypes.Requireable<PropTypes.InferProps<{
35
+ top: PropTypes.Requireable<number>;
36
+ bottom: PropTypes.Requireable<number>;
37
+ left: PropTypes.Requireable<number>;
38
+ right: PropTypes.Requireable<number>;
39
+ }>>;
40
+ clipPathComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
41
+ clipWidth: PropTypes.Requireable<number | undefined>;
42
+ events: PropTypes.Requireable<object>;
43
+ groupComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
44
+ origin: PropTypes.Requireable<PropTypes.InferProps<{
45
+ x: PropTypes.Requireable<number | undefined>;
46
+ y: PropTypes.Requireable<number | undefined>;
47
+ }>>;
48
+ polar: PropTypes.Requireable<boolean>;
49
+ radius: PropTypes.Requireable<number | undefined>;
50
+ style: PropTypes.Requireable<object>;
51
+ tabIndex: PropTypes.Requireable<number>;
52
+ transform: PropTypes.Requireable<string>;
53
+ translateX: PropTypes.Requireable<number>;
54
+ translateY: PropTypes.Requireable<number>;
55
+ };
56
+ static defaultProps: {
57
+ circleComponent: JSX.Element;
58
+ rectComponent: JSX.Element;
59
+ clipPathComponent: JSX.Element;
60
+ groupComponent: JSX.Element;
61
+ };
62
+ private clipId;
63
+ constructor(props: VictoryClipContainerProps);
64
+ calculateAttributes(props: any): {
65
+ x: number;
66
+ y: number;
67
+ width: number;
68
+ height: number;
69
+ };
70
+ renderClippedGroup(props: any, clipId: any): React.DetailedReactHTMLElement<any, HTMLElement>;
71
+ renderGroup(props: any): React.DetailedReactHTMLElement<any, HTMLElement>;
72
+ renderClipComponent(props: any, clipId: any): React.DetailedReactHTMLElement<any, HTMLElement>;
73
+ getClipValue(props: any, axis: any): any;
74
+ getTranslateValue(props: any, axis: any): any;
75
+ render(): React.DetailedReactHTMLElement<any, HTMLElement>;
76
+ }
77
+ //# sourceMappingURL=victory-clip-container.d.ts.map
@@ -19,6 +19,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
19
19
 
20
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
21
 
22
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
+
22
24
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
25
 
24
26
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -27,7 +29,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
27
29
 
28
30
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
29
31
 
30
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
32
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
33
 
32
34
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
33
35
 
@@ -37,19 +39,17 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
37
39
 
38
40
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
41
 
40
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
-
42
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
42
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
43
43
 
44
44
  import React from "react";
45
45
  import PropTypes from "prop-types";
46
46
  import * as CustomPropTypes from "../victory-util/prop-types";
47
47
  import * as Helpers from "../victory-util/helpers";
48
- import ClipPath from "../victory-primitives/clip-path";
49
- import Circle from "../victory-primitives/circle";
50
- import Rect from "../victory-primitives/rect";
51
-
52
- var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
48
+ import * as UserProps from "../victory-util/user-props";
49
+ import { ClipPath } from "../victory-primitives/clip-path";
50
+ import { Circle } from "../victory-primitives/circle";
51
+ import { Rect } from "../victory-primitives/rect";
52
+ export var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
53
53
  _inherits(VictoryClipContainer, _React$Component);
54
54
 
55
55
  var _super = _createSuper(VictoryClipContainer);
@@ -60,6 +60,7 @@ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
60
60
  _classCallCheck(this, VictoryClipContainer);
61
61
 
62
62
  _this = _super.call(this, props);
63
+ _this.clipId = void 0;
63
64
  _this.clipId = !_isObject(props) || props.clipId === undefined ? _uniqueId("victory-clip-") : props.clipId;
64
65
  return _this;
65
66
  }
@@ -91,6 +92,7 @@ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
91
92
  }, {
92
93
  key: "renderClippedGroup",
93
94
  value: function renderClippedGroup(props, clipId) {
95
+ var userProps = UserProps.getSafeUserProps(props);
94
96
  var style = props.style,
95
97
  events = props.events,
96
98
  transform = props.transform,
@@ -109,9 +111,8 @@ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
109
111
  }, events);
110
112
 
111
113
  return /*#__PURE__*/React.cloneElement(groupComponent, _objectSpread(_objectSpread({}, groupProps), {}, {
112
- "aria-label": props["aria-label"],
113
114
  tabIndex: tabIndex
114
- }), [clipComponent].concat(_toConsumableArray(React.Children.toArray(children))));
115
+ }, userProps), [clipComponent].concat(_toConsumableArray(React.Children.toArray(children))));
115
116
  }
116
117
  }, {
117
118
  key: "renderGroup",
@@ -238,12 +239,9 @@ var VictoryClipContainer = /*#__PURE__*/function (_React$Component) {
238
239
 
239
240
  return VictoryClipContainer;
240
241
  }(React.Component);
241
-
242
- _defineProperty(VictoryClipContainer, "displayName", "VictoryClipContainer");
243
-
244
- _defineProperty(VictoryClipContainer, "role", "container");
245
-
246
- _defineProperty(VictoryClipContainer, "propTypes", {
242
+ VictoryClipContainer.displayName = "VictoryClipContainer";
243
+ VictoryClipContainer.role = "container";
244
+ VictoryClipContainer.propTypes = {
247
245
  "aria-label": PropTypes.string,
248
246
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
249
247
  circleComponent: PropTypes.element,
@@ -271,13 +269,11 @@ _defineProperty(VictoryClipContainer, "propTypes", {
271
269
  transform: PropTypes.string,
272
270
  translateX: PropTypes.number,
273
271
  translateY: PropTypes.number
274
- });
275
-
276
- _defineProperty(VictoryClipContainer, "defaultProps", {
272
+ };
273
+ VictoryClipContainer.defaultProps = {
277
274
  circleComponent: /*#__PURE__*/React.createElement(Circle, null),
278
275
  rectComponent: /*#__PURE__*/React.createElement(Rect, null),
279
276
  clipPathComponent: /*#__PURE__*/React.createElement(ClipPath, null),
280
277
  groupComponent: /*#__PURE__*/React.createElement("g", null)
281
- });
282
-
283
- export { VictoryClipContainer as default };
278
+ };
279
+ //# sourceMappingURL=victory-clip-container.js.map
@@ -0,0 +1,100 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+ import { OriginType } from "../victory-label/victory-label";
4
+ import { D3Scale } from "../types/prop-types";
5
+ import { VictoryThemeDefinition } from "../victory-theme/types";
6
+ export interface VictoryContainerProps {
7
+ "aria-describedby"?: string;
8
+ "aria-labelledby"?: string;
9
+ children?: React.ReactElement | React.ReactElement[];
10
+ className?: string;
11
+ containerId?: number | string;
12
+ containerRef?: React.Ref<HTMLElement>;
13
+ desc?: string;
14
+ events?: React.DOMAttributes<any>;
15
+ height?: number;
16
+ name?: string;
17
+ origin?: OriginType;
18
+ ouiaId?: number | string;
19
+ ouiaSafe?: boolean;
20
+ ouiaType?: string;
21
+ polar?: boolean;
22
+ portalComponent?: React.ReactElement;
23
+ portalZIndex?: number;
24
+ preserveAspectRatio?: string;
25
+ responsive?: boolean;
26
+ role?: string;
27
+ scale?: {
28
+ x?: D3Scale;
29
+ y?: D3Scale;
30
+ };
31
+ style?: React.CSSProperties;
32
+ tabIndex?: number;
33
+ theme?: VictoryThemeDefinition;
34
+ title?: string;
35
+ width?: number;
36
+ }
37
+ export declare class VictoryContainer extends React.Component<VictoryContainerProps> {
38
+ static displayName: string;
39
+ static role: string;
40
+ static propTypes: {
41
+ "aria-describedby": PropTypes.Requireable<string>;
42
+ "aria-labelledby": PropTypes.Requireable<string>;
43
+ children: PropTypes.Requireable<string | number | boolean | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
44
+ className: PropTypes.Requireable<string>;
45
+ containerId: PropTypes.Requireable<string | number>;
46
+ containerRef: PropTypes.Requireable<(...args: any[]) => any>;
47
+ desc: PropTypes.Requireable<string>;
48
+ events: PropTypes.Requireable<object>;
49
+ height: PropTypes.Requireable<number | undefined>;
50
+ name: PropTypes.Requireable<string>;
51
+ origin: PropTypes.Requireable<PropTypes.InferProps<{
52
+ x: PropTypes.Requireable<number | undefined>;
53
+ y: PropTypes.Requireable<number | undefined>;
54
+ }>>;
55
+ ouiaId: PropTypes.Requireable<string | number>;
56
+ ouiaSafe: PropTypes.Requireable<boolean>;
57
+ ouiaType: PropTypes.Requireable<string>;
58
+ polar: PropTypes.Requireable<boolean>;
59
+ portalComponent: PropTypes.Requireable<PropTypes.ReactElementLike>;
60
+ portalZIndex: PropTypes.Requireable<number | undefined>;
61
+ preserveAspectRatio: PropTypes.Requireable<string>;
62
+ responsive: PropTypes.Requireable<boolean>;
63
+ role: PropTypes.Requireable<string>;
64
+ style: PropTypes.Requireable<object>;
65
+ tabIndex: PropTypes.Requireable<number>;
66
+ theme: PropTypes.Requireable<object>;
67
+ title: PropTypes.Requireable<string>;
68
+ width: PropTypes.Requireable<number | undefined>;
69
+ };
70
+ static defaultProps: {
71
+ className: string;
72
+ portalComponent: JSX.Element;
73
+ portalZIndex: number;
74
+ responsive: boolean;
75
+ role: string;
76
+ };
77
+ static contextType: React.Context<{
78
+ transitionTimer: import("..").Timer;
79
+ animationTimer: import("..").Timer;
80
+ }>;
81
+ private containerId;
82
+ private portalRef;
83
+ private containerRef;
84
+ private shouldHandleWheel;
85
+ constructor(props: VictoryContainerProps);
86
+ savePortalRef: (portal: any) => any;
87
+ portalUpdate: (key: any, el: any) => void;
88
+ portalRegister: () => number;
89
+ portalDeregister: (key: any) => void;
90
+ saveContainerRef: (container: HTMLElement) => HTMLElement;
91
+ handleWheel: (e: any) => any;
92
+ componentDidMount(): void;
93
+ componentWillUnmount(): void;
94
+ getIdForElement(elementName: any): string;
95
+ getChildren(props: any): any;
96
+ getOUIAProps(props: any): any;
97
+ renderContainer(props: any, svgProps: any, style: any): JSX.Element;
98
+ render(): JSX.Element;
99
+ }
100
+ //# sourceMappingURL=victory-container.d.ts.map
@@ -4,12 +4,14 @@ import _uniqueId from "lodash/uniqueId";
4
4
  import _defaults from "lodash/defaults";
5
5
  import _assign from "lodash/assign";
6
6
 
7
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
7
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
8
8
 
9
9
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
10
 
11
11
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
12
 
13
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+
13
15
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
16
 
15
17
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -18,7 +20,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
18
20
 
19
21
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
20
22
 
21
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
24
 
23
25
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
24
26
 
@@ -28,31 +30,33 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
28
30
 
29
31
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
30
32
 
31
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
-
33
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
34
34
 
35
35
  import React from "react";
36
36
  import PropTypes from "prop-types";
37
37
  import * as CustomPropTypes from "../victory-util/prop-types";
38
- import Portal from "../victory-portal/portal";
39
- import PortalContext from "../victory-portal/portal-context";
38
+ import { Portal } from "../victory-portal/portal";
39
+ import { PortalContext } from "../victory-portal/portal-context";
40
40
  import TimerContext from "../victory-util/timer-context";
41
41
  import * as Helpers from "../victory-util/helpers";
42
42
  import * as UserProps from "../victory-util/user-props";
43
-
44
- var VictoryContainer = /*#__PURE__*/function (_React$Component) {
43
+ export var VictoryContainer = /*#__PURE__*/function (_React$Component) {
45
44
  _inherits(VictoryContainer, _React$Component);
46
45
 
47
46
  var _super = _createSuper(VictoryContainer);
48
47
 
48
+ // @ts-expect-error Ref will be initialized on mount
49
+ // @ts-expect-error Ref will be initialized on mount
49
50
  function VictoryContainer(props) {
50
51
  var _this;
51
52
 
52
53
  _classCallCheck(this, VictoryContainer);
53
54
 
54
55
  _this = _super.call(this, props);
55
- _this.containerId = !_isObject(props) || props.containerId === undefined ? _uniqueId("victory-container-") : props.containerId;
56
+ _this.containerId = void 0;
57
+ _this.portalRef = void 0;
58
+ _this.containerRef = void 0;
59
+ _this.shouldHandleWheel = void 0;
56
60
 
57
61
  _this.savePortalRef = function (portal) {
58
62
  _this.portalRef = portal;
@@ -71,18 +75,21 @@ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
71
75
  return _this.portalRef.portalDeregister(key);
72
76
  };
73
77
 
74
- _this.saveContainerRef = props && _isFunction(props.containerRef) ? props.containerRef : function (container) {
78
+ _this.saveContainerRef = function (container) {
79
+ if (_isFunction(_this.props.containerRef)) {
80
+ _this.props.containerRef(container);
81
+ }
82
+
75
83
  _this.containerRef = container;
76
84
  return container;
77
85
  };
78
- _this.shouldHandleWheel = props && props.events && props.events.onWheel;
79
86
 
80
- if (_this.shouldHandleWheel) {
81
- _this.handleWheel = function (e) {
82
- return e.preventDefault();
83
- };
84
- }
87
+ _this.handleWheel = function (e) {
88
+ return e.preventDefault();
89
+ };
85
90
 
91
+ _this.containerId = !_isObject(props) || props.containerId === undefined ? _uniqueId("victory-container-") : props.containerId;
92
+ _this.shouldHandleWheel = !!(props && props.events && props.events.onWheel);
86
93
  return _this;
87
94
  }
88
95
 
@@ -230,12 +237,9 @@ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
230
237
 
231
238
  return VictoryContainer;
232
239
  }(React.Component);
233
-
234
- _defineProperty(VictoryContainer, "displayName", "VictoryContainer");
235
-
236
- _defineProperty(VictoryContainer, "role", "container");
237
-
238
- _defineProperty(VictoryContainer, "propTypes", {
240
+ VictoryContainer.displayName = "VictoryContainer";
241
+ VictoryContainer.role = "container";
242
+ VictoryContainer.propTypes = {
239
243
  "aria-describedby": PropTypes.string,
240
244
  "aria-labelledby": PropTypes.string,
241
245
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
@@ -264,16 +268,13 @@ _defineProperty(VictoryContainer, "propTypes", {
264
268
  theme: PropTypes.object,
265
269
  title: PropTypes.string,
266
270
  width: CustomPropTypes.nonNegative
267
- });
268
-
269
- _defineProperty(VictoryContainer, "defaultProps", {
271
+ };
272
+ VictoryContainer.defaultProps = {
270
273
  className: "VictoryContainer",
271
274
  portalComponent: /*#__PURE__*/React.createElement(Portal, null),
272
275
  portalZIndex: 99,
273
276
  responsive: true,
274
277
  role: "img"
275
- });
276
-
277
- _defineProperty(VictoryContainer, "contextType", TimerContext);
278
-
279
- export { VictoryContainer as default };
278
+ };
279
+ VictoryContainer.contextType = TimerContext;
280
+ //# sourceMappingURL=victory-container.js.map
@@ -0,0 +1,62 @@
1
+ import React from "react";
2
+ import { NumberOrCallback, StringOrCallback, StringOrNumberOrCallback } from "../types/callbacks";
3
+ import { PaddingProps, VerticalAnchorType, VictoryLabelStyleObject } from "../victory-theme/victory-theme";
4
+ export declare type TextAnchorType = "start" | "middle" | "end" | "inherit";
5
+ export declare type OriginType = {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ export declare type LabelOrientationType = "parallel" | "perpendicular" | "vertical";
10
+ export interface VictoryLabelProps {
11
+ angle?: StringOrNumberOrCallback;
12
+ ariaLabel?: StringOrCallback;
13
+ backgroundComponent?: React.ReactElement;
14
+ backgroundStyle?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
15
+ backgroundPadding?: PaddingProps | PaddingProps[];
16
+ capHeight?: StringOrNumberOrCallback;
17
+ children?: StringOrNumberOrCallback;
18
+ className?: string;
19
+ datum?: object;
20
+ data?: any[];
21
+ desc?: string;
22
+ direction?: string;
23
+ disableInlineStyles?: boolean;
24
+ events?: React.DOMAttributes<any>;
25
+ groupComponent?: React.ReactElement;
26
+ id?: StringOrNumberOrCallback;
27
+ inline?: boolean;
28
+ labelPlacement?: LabelOrientationType;
29
+ lineHeight?: StringOrNumberOrCallback | (string | number)[];
30
+ origin?: OriginType;
31
+ polar?: boolean;
32
+ renderInPortal?: boolean;
33
+ style?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
34
+ tabIndex?: NumberOrCallback;
35
+ text?: string[] | StringOrNumberOrCallback;
36
+ textComponent?: React.ReactElement;
37
+ textAnchor?: TextAnchorType | {
38
+ (): TextAnchorType;
39
+ };
40
+ title?: string;
41
+ transform?: string | object | (() => string | object);
42
+ tspanComponent?: React.ReactElement;
43
+ verticalAnchor?: VerticalAnchorType | {
44
+ (): VerticalAnchorType;
45
+ };
46
+ x?: number;
47
+ y?: number;
48
+ dx?: StringOrNumberOrCallback;
49
+ dy?: StringOrNumberOrCallback;
50
+ }
51
+ declare const defaultStyles: {
52
+ fill: string;
53
+ fontSize: number;
54
+ fontFamily: string;
55
+ stroke: string;
56
+ };
57
+ export declare const VictoryLabel: {
58
+ role: string;
59
+ defaultStyles: typeof defaultStyles;
60
+ } & React.FC<VictoryLabelProps>;
61
+ export {};
62
+ //# sourceMappingURL=victory-label.d.ts.map