@hitachivantara/uikit-react-viz 4.0.3 → 4.1.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 (195) hide show
  1. package/dist/Barchart/Barchart.js +45 -72
  2. package/dist/Barchart/Barchart.js.map +1 -1
  3. package/dist/Barchart/barchartPlotlyOverrides.js +1 -13
  4. package/dist/Barchart/barchartPlotlyOverrides.js.map +1 -1
  5. package/dist/Barchart/index.js +0 -2
  6. package/dist/Barchart/index.js.map +1 -1
  7. package/dist/Barchart/styles.js.map +1 -1
  8. package/dist/Chart/Chart.js +30 -76
  9. package/dist/Chart/Chart.js.map +1 -1
  10. package/dist/Chart/Plot/Plot.js +11 -48
  11. package/dist/Chart/Plot/Plot.js.map +1 -1
  12. package/dist/Chart/Plot/index.js +0 -2
  13. package/dist/Chart/Plot/index.js.map +1 -1
  14. package/dist/Chart/Plot/styles.js.map +1 -1
  15. package/dist/Chart/Tooltip/MultiTooltip/MultiTooltip.js +1 -36
  16. package/dist/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +1 -1
  17. package/dist/Chart/Tooltip/MultiTooltip/index.js +0 -2
  18. package/dist/Chart/Tooltip/MultiTooltip/index.js.map +1 -1
  19. package/dist/Chart/Tooltip/MultiTooltip/styles.js +0 -2
  20. package/dist/Chart/Tooltip/MultiTooltip/styles.js.map +1 -1
  21. package/dist/Chart/Tooltip/SingleTooltip/SingleTooltip.js +2 -26
  22. package/dist/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +1 -1
  23. package/dist/Chart/Tooltip/SingleTooltip/index.js +0 -2
  24. package/dist/Chart/Tooltip/SingleTooltip/index.js.map +1 -1
  25. package/dist/Chart/Tooltip/SingleTooltip/styles.js +0 -2
  26. package/dist/Chart/Tooltip/SingleTooltip/styles.js.map +1 -1
  27. package/dist/Chart/Tooltip/Tooltip.js +16 -51
  28. package/dist/Chart/Tooltip/Tooltip.js.map +1 -1
  29. package/dist/Chart/Tooltip/index.js +0 -2
  30. package/dist/Chart/Tooltip/index.js.map +1 -1
  31. package/dist/Chart/Tooltip/styles.js.map +1 -1
  32. package/dist/Chart/chartPlotlyOverrides.js +9 -33
  33. package/dist/Chart/chartPlotlyOverrides.js.map +1 -1
  34. package/dist/Chart/index.js +0 -2
  35. package/dist/Chart/index.js.map +1 -1
  36. package/dist/Chart/styles.js +0 -13
  37. package/dist/Chart/styles.js.map +1 -1
  38. package/dist/ConfusionMatrix/ConfusionMatrix.d.ts +10 -0
  39. package/dist/ConfusionMatrix/ConfusionMatrix.js +102 -0
  40. package/dist/ConfusionMatrix/ConfusionMatrix.js.map +1 -0
  41. package/dist/ConfusionMatrix/CustomTooltip/CustomTooltip.js +47 -0
  42. package/dist/ConfusionMatrix/CustomTooltip/CustomTooltip.js.map +1 -0
  43. package/dist/ConfusionMatrix/CustomTooltip/index.js +14 -0
  44. package/dist/ConfusionMatrix/CustomTooltip/index.js.map +1 -0
  45. package/dist/ConfusionMatrix/CustomTooltip/styles.js +26 -0
  46. package/dist/ConfusionMatrix/CustomTooltip/styles.js.map +1 -0
  47. package/dist/ConfusionMatrix/confusionMatrixPlotlyOverrides.js +189 -0
  48. package/dist/ConfusionMatrix/confusionMatrixPlotlyOverrides.js.map +1 -0
  49. package/dist/ConfusionMatrix/index.d.ts +2 -0
  50. package/dist/ConfusionMatrix/index.js +14 -0
  51. package/dist/ConfusionMatrix/index.js.map +1 -0
  52. package/dist/ConfusionMatrix/styles.js +10 -0
  53. package/dist/ConfusionMatrix/styles.js.map +1 -0
  54. package/dist/Donutchart/Donutchart.js +10 -47
  55. package/dist/Donutchart/Donutchart.js.map +1 -1
  56. package/dist/Donutchart/donutchartPlotlyOverrides.js +1 -13
  57. package/dist/Donutchart/donutchartPlotlyOverrides.js.map +1 -1
  58. package/dist/Donutchart/index.js +0 -2
  59. package/dist/Donutchart/index.js.map +1 -1
  60. package/dist/Donutchart/styles.js.map +1 -1
  61. package/dist/Linechart/Linechart.js +12 -50
  62. package/dist/Linechart/Linechart.js.map +1 -1
  63. package/dist/Linechart/index.js +0 -2
  64. package/dist/Linechart/index.js.map +1 -1
  65. package/dist/Linechart/lineChartPlotlyOverrides.js +1 -17
  66. package/dist/Linechart/lineChartPlotlyOverrides.js.map +1 -1
  67. package/dist/Linechart/styles.js.map +1 -1
  68. package/dist/index.d.ts +3 -0
  69. package/dist/index.js +7 -4
  70. package/dist/index.js.map +1 -1
  71. package/dist/legacy/Barchart/Barchart.js +45 -43
  72. package/dist/legacy/Barchart/Barchart.js.map +1 -1
  73. package/dist/legacy/Barchart/barchartPlotlyOverrides.js +1 -6
  74. package/dist/legacy/Barchart/barchartPlotlyOverrides.js.map +1 -1
  75. package/dist/legacy/Barchart/index.js.map +1 -1
  76. package/dist/legacy/Barchart/styles.js.map +1 -1
  77. package/dist/legacy/Chart/Chart.js +30 -47
  78. package/dist/legacy/Chart/Chart.js.map +1 -1
  79. package/dist/legacy/Chart/Plot/Plot.js +11 -22
  80. package/dist/legacy/Chart/Plot/Plot.js.map +1 -1
  81. package/dist/legacy/Chart/Plot/index.js.map +1 -1
  82. package/dist/legacy/Chart/Plot/styles.js.map +1 -1
  83. package/dist/legacy/Chart/Tooltip/MultiTooltip/MultiTooltip.js +1 -17
  84. package/dist/legacy/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +1 -1
  85. package/dist/legacy/Chart/Tooltip/MultiTooltip/index.js.map +1 -1
  86. package/dist/legacy/Chart/Tooltip/MultiTooltip/styles.js +0 -1
  87. package/dist/legacy/Chart/Tooltip/MultiTooltip/styles.js.map +1 -1
  88. package/dist/legacy/Chart/Tooltip/SingleTooltip/SingleTooltip.js +2 -9
  89. package/dist/legacy/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +1 -1
  90. package/dist/legacy/Chart/Tooltip/SingleTooltip/index.js.map +1 -1
  91. package/dist/legacy/Chart/Tooltip/SingleTooltip/styles.js +0 -1
  92. package/dist/legacy/Chart/Tooltip/SingleTooltip/styles.js.map +1 -1
  93. package/dist/legacy/Chart/Tooltip/Tooltip.js +16 -30
  94. package/dist/legacy/Chart/Tooltip/Tooltip.js.map +1 -1
  95. package/dist/legacy/Chart/Tooltip/index.js.map +1 -1
  96. package/dist/legacy/Chart/Tooltip/styles.js.map +1 -1
  97. package/dist/legacy/Chart/chartPlotlyOverrides.js +9 -20
  98. package/dist/legacy/Chart/chartPlotlyOverrides.js.map +1 -1
  99. package/dist/legacy/Chart/index.js.map +1 -1
  100. package/dist/legacy/Chart/styles.js +0 -4
  101. package/dist/legacy/Chart/styles.js.map +1 -1
  102. package/dist/legacy/ConfusionMatrix/ConfusionMatrix.d.ts +10 -0
  103. package/dist/legacy/ConfusionMatrix/ConfusionMatrix.js +87 -0
  104. package/dist/legacy/ConfusionMatrix/ConfusionMatrix.js.map +1 -0
  105. package/dist/legacy/ConfusionMatrix/CustomTooltip/CustomTooltip.js +39 -0
  106. package/dist/legacy/ConfusionMatrix/CustomTooltip/CustomTooltip.js.map +1 -0
  107. package/dist/legacy/ConfusionMatrix/CustomTooltip/index.js +2 -0
  108. package/dist/legacy/ConfusionMatrix/CustomTooltip/index.js.map +1 -0
  109. package/dist/legacy/ConfusionMatrix/CustomTooltip/styles.js +19 -0
  110. package/dist/legacy/ConfusionMatrix/CustomTooltip/styles.js.map +1 -0
  111. package/dist/legacy/ConfusionMatrix/confusionMatrixPlotlyOverrides.js +181 -0
  112. package/dist/legacy/ConfusionMatrix/confusionMatrixPlotlyOverrides.js.map +1 -0
  113. package/dist/legacy/ConfusionMatrix/index.d.ts +2 -0
  114. package/dist/legacy/ConfusionMatrix/index.js +2 -0
  115. package/dist/legacy/ConfusionMatrix/index.js.map +1 -0
  116. package/dist/legacy/ConfusionMatrix/styles.js +3 -0
  117. package/dist/legacy/ConfusionMatrix/styles.js.map +1 -0
  118. package/dist/legacy/Donutchart/Donutchart.js +11 -22
  119. package/dist/legacy/Donutchart/Donutchart.js.map +1 -1
  120. package/dist/legacy/Donutchart/donutchartPlotlyOverrides.js +1 -6
  121. package/dist/legacy/Donutchart/donutchartPlotlyOverrides.js.map +1 -1
  122. package/dist/legacy/Donutchart/index.js.map +1 -1
  123. package/dist/legacy/Donutchart/styles.js.map +1 -1
  124. package/dist/legacy/Linechart/Linechart.js +13 -25
  125. package/dist/legacy/Linechart/Linechart.js.map +1 -1
  126. package/dist/legacy/Linechart/index.js.map +1 -1
  127. package/dist/legacy/Linechart/lineChartPlotlyOverrides.js +1 -10
  128. package/dist/legacy/Linechart/lineChartPlotlyOverrides.js.map +1 -1
  129. package/dist/legacy/Linechart/styles.js.map +1 -1
  130. package/dist/legacy/index.d.ts +3 -0
  131. package/dist/legacy/index.js +1 -0
  132. package/dist/legacy/index.js.map +1 -1
  133. package/dist/modern/Barchart/Barchart.js +38 -31
  134. package/dist/modern/Barchart/Barchart.js.map +1 -1
  135. package/dist/modern/Barchart/barchartPlotlyOverrides.js +1 -6
  136. package/dist/modern/Barchart/barchartPlotlyOverrides.js.map +1 -1
  137. package/dist/modern/Barchart/index.js.map +1 -1
  138. package/dist/modern/Barchart/styles.js.map +1 -1
  139. package/dist/modern/Chart/Chart.js +19 -34
  140. package/dist/modern/Chart/Chart.js.map +1 -1
  141. package/dist/modern/Chart/Plot/Plot.js +12 -23
  142. package/dist/modern/Chart/Plot/Plot.js.map +1 -1
  143. package/dist/modern/Chart/Plot/index.js.map +1 -1
  144. package/dist/modern/Chart/Plot/styles.js.map +1 -1
  145. package/dist/modern/Chart/Tooltip/MultiTooltip/MultiTooltip.js +0 -17
  146. package/dist/modern/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +1 -1
  147. package/dist/modern/Chart/Tooltip/MultiTooltip/index.js.map +1 -1
  148. package/dist/modern/Chart/Tooltip/MultiTooltip/styles.js +0 -1
  149. package/dist/modern/Chart/Tooltip/MultiTooltip/styles.js.map +1 -1
  150. package/dist/modern/Chart/Tooltip/SingleTooltip/SingleTooltip.js +0 -7
  151. package/dist/modern/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +1 -1
  152. package/dist/modern/Chart/Tooltip/SingleTooltip/index.js.map +1 -1
  153. package/dist/modern/Chart/Tooltip/SingleTooltip/styles.js +0 -1
  154. package/dist/modern/Chart/Tooltip/SingleTooltip/styles.js.map +1 -1
  155. package/dist/modern/Chart/Tooltip/Tooltip.js +2 -13
  156. package/dist/modern/Chart/Tooltip/Tooltip.js.map +1 -1
  157. package/dist/modern/Chart/Tooltip/index.js.map +1 -1
  158. package/dist/modern/Chart/Tooltip/styles.js.map +1 -1
  159. package/dist/modern/Chart/chartPlotlyOverrides.js +9 -20
  160. package/dist/modern/Chart/chartPlotlyOverrides.js.map +1 -1
  161. package/dist/modern/Chart/index.js.map +1 -1
  162. package/dist/modern/Chart/styles.js +0 -4
  163. package/dist/modern/Chart/styles.js.map +1 -1
  164. package/dist/modern/ConfusionMatrix/ConfusionMatrix.d.ts +10 -0
  165. package/dist/modern/ConfusionMatrix/ConfusionMatrix.js +76 -0
  166. package/dist/modern/ConfusionMatrix/ConfusionMatrix.js.map +1 -0
  167. package/dist/modern/ConfusionMatrix/CustomTooltip/CustomTooltip.js +37 -0
  168. package/dist/modern/ConfusionMatrix/CustomTooltip/CustomTooltip.js.map +1 -0
  169. package/dist/modern/ConfusionMatrix/CustomTooltip/index.js +2 -0
  170. package/dist/modern/ConfusionMatrix/CustomTooltip/index.js.map +1 -0
  171. package/dist/modern/ConfusionMatrix/CustomTooltip/styles.js +17 -0
  172. package/dist/modern/ConfusionMatrix/CustomTooltip/styles.js.map +1 -0
  173. package/dist/modern/ConfusionMatrix/confusionMatrixPlotlyOverrides.js +154 -0
  174. package/dist/modern/ConfusionMatrix/confusionMatrixPlotlyOverrides.js.map +1 -0
  175. package/dist/modern/ConfusionMatrix/index.d.ts +2 -0
  176. package/dist/modern/ConfusionMatrix/index.js +2 -0
  177. package/dist/modern/ConfusionMatrix/index.js.map +1 -0
  178. package/dist/modern/ConfusionMatrix/styles.js +3 -0
  179. package/dist/modern/ConfusionMatrix/styles.js.map +1 -0
  180. package/dist/modern/Donutchart/Donutchart.js +11 -22
  181. package/dist/modern/Donutchart/Donutchart.js.map +1 -1
  182. package/dist/modern/Donutchart/donutchartPlotlyOverrides.js +1 -6
  183. package/dist/modern/Donutchart/donutchartPlotlyOverrides.js.map +1 -1
  184. package/dist/modern/Donutchart/index.js.map +1 -1
  185. package/dist/modern/Donutchart/styles.js.map +1 -1
  186. package/dist/modern/Linechart/Linechart.js +12 -24
  187. package/dist/modern/Linechart/Linechart.js.map +1 -1
  188. package/dist/modern/Linechart/index.js.map +1 -1
  189. package/dist/modern/Linechart/lineChartPlotlyOverrides.js +1 -10
  190. package/dist/modern/Linechart/lineChartPlotlyOverrides.js.map +1 -1
  191. package/dist/modern/Linechart/styles.js.map +1 -1
  192. package/dist/modern/index.d.ts +3 -0
  193. package/dist/modern/index.js +1 -0
  194. package/dist/modern/index.js.map +1 -1
  195. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"MultiTooltip.js","names":["MultiTooltip","classes","data","root","title","valuesContainer","elements","map","element","values","valueNameWrapper","color","backgroundColor","separatorColor","name","separator","value","propTypes","PropTypes","shape","string","isRequired","arrayOf","number","arePropsEqual","prevProps","nextProps","withStyles","styles","memo"],"sources":["../../../../src/Chart/Tooltip/MultiTooltip/MultiTooltip.js"],"sourcesContent":["import React, { memo } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport styles from \"./styles\";\n\nconst MultiTooltip = ({ classes, data }) => (\n <div className={classes.root}>\n <div className={classes.title}>\n <div>\n <HvTypography variant=\"highlightText\">{data.title}</HvTypography>\n </div>\n </div>\n <div className={classes.valuesContainer}>\n {data?.elements?.map((element) => (\n <div key={element.name} className={classes.values}>\n <div className={classes.valueNameWrapper}>\n <div className={classes.color} style={{ backgroundColor: element.color }} />\n <div className={classes.separatorColor} />\n <div>\n <HvTypography variant=\"highlightText\">{element.name}</HvTypography>\n </div>\n <div className={classes.separator} />\n </div>\n <div>\n <HvTypography>{element.value}</HvTypography>\n </div>\n </div>\n ))}\n </div>\n </div>\n);\n\nMultiTooltip.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the root.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the title.\n */\n title: PropTypes.string,\n /**\n * Styles applied to the values container.\n */\n valuesContainer: PropTypes.string,\n /**\n * Styling applied to the elements describing a data.\n */\n valueNameWrapper: PropTypes.string,\n /**\n * Styles applied to the values.\n */\n values: PropTypes.string,\n /**\n * Styles applied to the color.\n */\n color: PropTypes.string,\n /**\n * Styles applied to the separator between color and title.\n */\n separatorColor: PropTypes.string,\n /**\n * Styles applied to the separator.\n */\n separator: PropTypes.string,\n }).isRequired,\n /**\n * Data of the tooltip.\n */\n data: PropTypes.shape({\n /**\n * Styles applied to the barchart root class.\n */\n title: PropTypes.string,\n /**\n * Values of tooltip\n */\n elements: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Color (in hex).\n */\n color: PropTypes.string,\n /**\n * Name.\n */\n name: PropTypes.string,\n /**\n * Value.\n */\n value: PropTypes.number,\n })\n ),\n }).isRequired,\n};\n\nconst arePropsEqual = (prevProps, nextProps) => prevProps.data === nextProps.data;\n\nexport default withStyles(styles, { name: \"HvChartMultiTooltip\" })(\n memo(MultiTooltip, arePropsEqual)\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,YAAY,GAAG,SAAfA,YAAe;EAAA;;EAAA,IAAGC,OAAH,QAAGA,OAAH;EAAA,IAAYC,IAAZ,QAAYA,IAAZ;EAAA,oBACnB;IAAK,SAAS,EAAED,OAAO,CAACE,IAAxB;IAAA,wBACE;MAAK,SAAS,EAAEF,OAAO,CAACG,KAAxB;MAAA,uBACE;QAAA,uBACE,qBAAC,4BAAD;UAAc,OAAO,E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AK,EAAEO,kBAAA,CAAUE,MAxBM;;IAyBvB;AACJ;AACA;IACIP,cAAc,EAAEK,kBAAA,CAAUE,MA5BH;;IA6BvB;AACJ;AACA;IACIL,SAAS,EAAEG,kBAAA,CAAUE;EAhCE,CAAhB,EAiCNC,UArCoB;;EAsCvB;AACF;AACA;EACEnB,IAAI,EAAEgB,kBAAA,CAAUC,KAAV,CAAgB;IACpB;AACJ;AACA;IACIf,KAAK,EAAEc,kBAAA,CAAUE,MAJG;;IAKpB;AACJ;AACA;IACId,QAAQ,EAAEY,kBAAA,CAAUI,OAAV,CACRJ,kBAAA,CAAUC,KAAV,CAAgB;MACd;AACR;AACA;MACQR,KAAK,EAAEO,kBAAA,CAAUE,MAJH;;MAKd;AACR;AACA;MACQN,IAAI,EAAEI,kBAAA,CAAUE,MARF;;MASd;AACR;AACA;MACQJ,KAAK,EAAEE,kBAAA,CAAUK;IAZH,CAAhB,CADQ;EARU,CAAhB,EAwBHF;AAjEoB,CAAzB;;AAoEA,IAAMG,aAAa,GAAG,SAAhBA,aAAgB,CAACC,SAAD,EAAYC,SAAZ;EAAA,OAA0BD,SAAS,CAACvB,IAAV,KAAmBwB,SAAS,CAACxB,IAAvD;AAAA,CAAtB;;eAEe,IAAAyB,kBAAA,EAAWC,gBAAX,EAAmB;EAAEd,IAAI,EAAE;AAAR,CAAnB,gBACb,IAAAe,WAAA,EAAK7B,YAAL,EAAmBwB,aAAnB,CADa,C"}
1
+ {"version":3,"file":"MultiTooltip.js","names":["MultiTooltip","classes","data","root","title","valuesContainer","elements","map","element","values","valueNameWrapper","color","backgroundColor","separatorColor","name","separator","value","propTypes","PropTypes","shape","string","isRequired","arrayOf","number","arePropsEqual","prevProps","nextProps","withStyles","styles","memo"],"sources":["../../../../src/Chart/Tooltip/MultiTooltip/MultiTooltip.js"],"sourcesContent":["import React, { memo } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport styles from \"./styles\";\n\nconst MultiTooltip = ({ classes, data }) => (\n <div className={classes.root}>\n <div className={classes.title}>\n <div>\n <HvTypography variant=\"highlightText\">{data.title}</HvTypography>\n </div>\n </div>\n <div className={classes.valuesContainer}>\n {data?.elements?.map((element) => (\n <div key={element.name} className={classes.values}>\n <div className={classes.valueNameWrapper}>\n <div className={classes.color} style={{ backgroundColor: element.color }} />\n <div className={classes.separatorColor} />\n <div>\n <HvTypography variant=\"highlightText\">{element.name}</HvTypography>\n </div>\n <div className={classes.separator} />\n </div>\n <div>\n <HvTypography>{element.value}</HvTypography>\n </div>\n </div>\n ))}\n </div>\n </div>\n);\n\nMultiTooltip.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the root.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the title.\n */\n title: PropTypes.string,\n /**\n * Styles applied to the values container.\n */\n valuesContainer: PropTypes.string,\n /**\n * Styling applied to the elements describing a data.\n */\n valueNameWrapper: PropTypes.string,\n /**\n * Styles applied to the values.\n */\n values: PropTypes.string,\n /**\n * Styles applied to the color.\n */\n color: PropTypes.string,\n /**\n * Styles applied to the separator between color and title.\n */\n separatorColor: PropTypes.string,\n /**\n * Styles applied to the separator.\n */\n separator: PropTypes.string,\n }).isRequired,\n /**\n * Data of the tooltip.\n */\n data: PropTypes.shape({\n /**\n * Styles applied to the barchart root class.\n */\n title: PropTypes.string,\n /**\n * Values of tooltip\n */\n elements: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Color (in hex).\n */\n color: PropTypes.string,\n /**\n * Name.\n */\n name: PropTypes.string,\n /**\n * Value.\n */\n value: PropTypes.number,\n })\n ),\n }).isRequired,\n};\n\nconst arePropsEqual = (prevProps, nextProps) => prevProps.data === nextProps.data;\n\nexport default withStyles(styles, { name: \"HvChartMultiTooltip\" })(\n memo(MultiTooltip, arePropsEqual)\n);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;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AI,EAAEe,kBAAS,CAACE,MAAM;IACtB;AACJ;AACA;IACIhB,KAAK,EAAEc,kBAAS,CAACE,MAAM;IACvB;AACJ;AACA;IACIf,eAAe,EAAEa,kBAAS,CAACE,MAAM;IACjC;AACJ;AACA;IACIV,gBAAgB,EAAEQ,kBAAS,CAACE,MAAM;IAClC;AACJ;AACA;IACIX,MAAM,EAAES,kBAAS,CAACE,MAAM;IACxB;AACJ;AACA;IACIT,KAAK,EAAEO,kBAAS,CAACE,MAAM;IACvB;AACJ;AACA;IACIP,cAAc,EAAEK,kBAAS,CAACE,MAAM;IAChC;AACJ;AACA;IACIL,SAAS,EAAEG,kBAAS,CAACE;EACvB,CAAC,CAAC,CAACC,UAAU;EACb;AACF;AACA;EACEnB,IAAI,EAAEgB,kBAAS,CAACC,KAAK,CAAC;IACpB;AACJ;AACA;IACIf,KAAK,EAAEc,kBAAS,CAACE,MAAM;IACvB;AACJ;AACA;IACId,QAAQ,EAAEY,kBAAS,CAACI,OAAO,CACzBJ,kBAAS,CAACC,KAAK,CAAC;MACd;AACR;AACA;MACQR,KAAK,EAAEO,kBAAS,CAACE,MAAM;MACvB;AACR;AACA;MACQN,IAAI,EAAEI,kBAAS,CAACE,MAAM;MACtB;AACR;AACA;MACQJ,KAAK,EAAEE,kBAAS,CAACK;IACnB,CAAC,CAAC;EAEN,CAAC,CAAC,CAACF;AACL,CAAC;AAED,IAAMG,aAAa,GAAG,SAAhBA,aAAa,CAAIC,SAAS,EAAEC,SAAS;EAAA,OAAKD,SAAS,CAACvB,IAAI,KAAKwB,SAAS,CAACxB,IAAI;AAAA;AAAC,eAEnE,IAAAyB,kBAAU,EAACC,gBAAM,EAAE;EAAEd,IAAI,EAAE;AAAsB,CAAC,CAAC,eAChE,IAAAe,WAAI,EAAC7B,YAAY,EAAEwB,aAAa,CAAC,CAClC;AAAA"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -11,6 +10,5 @@ Object.defineProperty(exports, "default", {
11
10
  return _MultiTooltip.default;
12
11
  }
13
12
  });
14
-
15
13
  var _MultiTooltip = _interopRequireDefault(require("./MultiTooltip"));
16
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/Chart/Tooltip/MultiTooltip/index.js"],"sourcesContent":["export { default } from \"./MultiTooltip\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/Chart/Tooltip/MultiTooltip/index.js"],"sourcesContent":["export { default } from \"./MultiTooltip\";\n"],"mappings":";;;;;;;;;;;;AAAA"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var styles = function styles(theme) {
9
8
  return {
10
9
  root: {
@@ -45,7 +44,6 @@ var styles = function styles(theme) {
45
44
  }
46
45
  };
47
46
  };
48
-
49
47
  var _default = styles;
50
48
  exports.default = _default;
51
49
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["styles","theme","root","backgroundColor","hv","palette","atmosphere","atmo1","width","boxShadow","shadows","zIndex","title","padding","hvSpacing","borderBottom","atmo2","valuesContainer","spacing","sm","values","display","justifyContent","alignItems","paddingBottom","valueNameWrapper","color","xs","height","separator","separatorColor"],"sources":["../../../../src/Chart/Tooltip/MultiTooltip/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n width: \"fit-content\",\n boxShadow: theme.hv.shadows[1],\n zIndex: 100,\n },\n title: {\n padding: theme.hvSpacing(\"15px\", \"sm\"),\n borderBottom: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n },\n valuesContainer: {\n padding: theme.hv.spacing.sm,\n },\n values: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n paddingBottom: theme.hv.spacing.sm,\n \"&:last-child\": {\n paddingBottom: 0,\n },\n },\n valueNameWrapper: {\n display: \"flex\",\n alignItems: \"center\",\n },\n color: {\n width: theme.hv.spacing.xs,\n height: theme.hv.spacing.xs,\n },\n separator: {\n width: theme.hv.spacing.xs,\n },\n separatorColor: {\n width: \"5px\",\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;EAAA,OAAY;IACzBC,IAAI,EAAE;MACJC,eAAe,EAAEF,KAAK,CAACG,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BC,KADzC;MAEJC,KAAK,EAAE,aAFH;MAGJC,SAAS,EAAER,KAAK,CAACG,EAAN,CAASM,OAAT,CAAiB,CAAjB,CAHP;MAIJC,MAAM,EAAE;IAJJ,CADmB;IAOzBC,KAAK,EAAE;MACLC,OAAO,EAAEZ,KAAK,CAACa,SAAN,CAAgB,MAAhB,EAAwB,IAAxB,CADJ;MAELC,YAAY,sBAAed,KAAK,CAACG,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BU,KAA3C;IAFP,CAPkB;IAWzBC,eAAe,EAAE;MACfJ,OAAO,EAAEZ,KAAK,CAACG,EAAN,CAASc,OAAT,CAAiBC;IADX,CAXQ;IAczBC,MAAM,EAAE;MACNC,OAAO,EAAE,MADH;MAENC,cAAc,EAAE,eAFV;MAGNC,UAAU,EAAE,QAHN;MAINC,aAAa,EAAEvB,KAAK,CAACG,EAAN,CAASc,OAAT,CAAiBC,EAJ1B;MAKN,gBAAgB;QACdK,aAAa,EAAE;MADD;IALV,CAdiB;IAuBzBC,gBAAgB,EAAE;MAChBJ,OAAO,EAAE,MADO;MAEhBE,UAAU,EAAE;IAFI,CAvBO;IA2BzBG,KAAK,EAAE;MACLlB,KAAK,EAAEP,KAAK,CAACG,EAAN,CAASc,OAAT,CAAiBS,EADnB;MAELC,MAAM,EAAE3B,KAAK,CAACG,EAAN,CAASc,OAAT,CAAiBS;IAFpB,CA3BkB;IA+BzBE,SAAS,EAAE;MACTrB,KAAK,EAAEP,KAAK,CAACG,EAAN,CAASc,OAAT,CAAiBS;IADf,CA/Bc;IAkCzBG,cAAc,EAAE;MACdtB,KAAK,EAAE;IADO;EAlCS,CAAZ;AAAA,CAAf;;eAuCeR,M"}
1
+ {"version":3,"file":"styles.js","names":["styles","theme","root","backgroundColor","hv","palette","atmosphere","atmo1","width","boxShadow","shadows","zIndex","title","padding","hvSpacing","borderBottom","atmo2","valuesContainer","spacing","sm","values","display","justifyContent","alignItems","paddingBottom","valueNameWrapper","color","xs","height","separator","separatorColor"],"sources":["../../../../src/Chart/Tooltip/MultiTooltip/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n width: \"fit-content\",\n boxShadow: theme.hv.shadows[1],\n zIndex: 100,\n },\n title: {\n padding: theme.hvSpacing(\"15px\", \"sm\"),\n borderBottom: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n },\n valuesContainer: {\n padding: theme.hv.spacing.sm,\n },\n values: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n paddingBottom: theme.hv.spacing.sm,\n \"&:last-child\": {\n paddingBottom: 0,\n },\n },\n valueNameWrapper: {\n display: \"flex\",\n alignItems: \"center\",\n },\n color: {\n width: theme.hv.spacing.xs,\n height: theme.hv.spacing.xs,\n },\n separator: {\n width: theme.hv.spacing.xs,\n },\n separatorColor: {\n width: \"5px\",\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;AAAA,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAIC,KAAK;EAAA,OAAM;IACzBC,IAAI,EAAE;MACJC,eAAe,EAAEF,KAAK,CAACG,EAAE,CAACC,OAAO,CAACC,UAAU,CAACC,KAAK;MAClDC,KAAK,EAAE,aAAa;MACpBC,SAAS,EAAER,KAAK,CAACG,EAAE,CAACM,OAAO,CAAC,CAAC,CAAC;MAC9BC,MAAM,EAAE;IACV,CAAC;IACDC,KAAK,EAAE;MACLC,OAAO,EAAEZ,KAAK,CAACa,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC;MACtCC,YAAY,sBAAed,KAAK,CAACG,EAAE,CAACC,OAAO,CAACC,UAAU,CAACU,KAAK;IAC9D,CAAC;IACDC,eAAe,EAAE;MACfJ,OAAO,EAAEZ,KAAK,CAACG,EAAE,CAACc,OAAO,CAACC;IAC5B,CAAC;IACDC,MAAM,EAAE;MACNC,OAAO,EAAE,MAAM;MACfC,cAAc,EAAE,eAAe;MAC/BC,UAAU,EAAE,QAAQ;MACpBC,aAAa,EAAEvB,KAAK,CAACG,EAAE,CAACc,OAAO,CAACC,EAAE;MAClC,cAAc,EAAE;QACdK,aAAa,EAAE;MACjB;IACF,CAAC;IACDC,gBAAgB,EAAE;MAChBJ,OAAO,EAAE,MAAM;MACfE,UAAU,EAAE;IACd,CAAC;IACDG,KAAK,EAAE;MACLlB,KAAK,EAAEP,KAAK,CAACG,EAAE,CAACc,OAAO,CAACS,EAAE;MAC1BC,MAAM,EAAE3B,KAAK,CAACG,EAAE,CAACc,OAAO,CAACS;IAC3B,CAAC;IACDE,SAAS,EAAE;MACTrB,KAAK,EAAEP,KAAK,CAACG,EAAE,CAACc,OAAO,CAACS;IAC1B,CAAC;IACDG,cAAc,EAAE;MACdtB,KAAK,EAAE;IACT;EACF,CAAC;AAAA,CAAC;AAAC,eAEYR,MAAM;AAAA"}
@@ -1,46 +1,29 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.array.iterator.js");
4
-
5
4
  require("core-js/modules/es.object.to-string.js");
6
-
7
5
  require("core-js/modules/es.string.iterator.js");
8
-
9
6
  require("core-js/modules/es.weak-map.js");
10
-
11
7
  require("core-js/modules/web.dom-collections.iterator.js");
12
-
13
8
  require("core-js/modules/es.object.get-own-property-descriptor.js");
14
-
15
9
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
16
-
17
10
  var _typeof = require("@babel/runtime/helpers/typeof");
18
-
19
11
  Object.defineProperty(exports, "__esModule", {
20
12
  value: true
21
13
  });
22
14
  exports.default = void 0;
23
-
24
15
  var _react = _interopRequireWildcard(require("react"));
25
-
26
16
  var _propTypes = _interopRequireDefault(require("prop-types"));
27
-
28
17
  var _styles = require("@mui/styles");
29
-
30
18
  var _uikitReactCore = require("@hitachivantara/uikit-react-core");
31
-
32
19
  var _styles2 = _interopRequireDefault(require("./styles"));
33
-
34
20
  var _jsxRuntime = require("react/jsx-runtime");
35
-
36
21
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
-
38
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
-
40
23
  var SingleTooltip = function SingleTooltip(_ref) {
41
24
  var classes = _ref.classes,
42
- title = _ref.title,
43
- value = _ref.value;
25
+ title = _ref.title,
26
+ value = _ref.value;
44
27
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
45
28
  className: classes.root,
46
29
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -57,7 +40,6 @@ var SingleTooltip = function SingleTooltip(_ref) {
57
40
  })]
58
41
  });
59
42
  };
60
-
61
43
  process.env.NODE_ENV !== "production" ? SingleTooltip.propTypes = {
62
44
  /**
63
45
  * A Jss Object used to override or extend the styles applied.
@@ -67,31 +49,25 @@ process.env.NODE_ENV !== "production" ? SingleTooltip.propTypes = {
67
49
  * Styles applied to the root class.
68
50
  */
69
51
  root: _propTypes.default.string,
70
-
71
52
  /**
72
53
  * Styles applied to the separator between title and value.
73
54
  */
74
55
  separator: _propTypes.default.string
75
56
  }).isRequired,
76
-
77
57
  /**
78
58
  * Title of the chart.
79
59
  */
80
60
  title: _propTypes.default.string.isRequired,
81
-
82
61
  /**
83
62
  * Value of the chart.
84
63
  */
85
64
  value: _propTypes.default.number.isRequired
86
65
  } : void 0;
87
-
88
66
  var arePropsEqual = function arePropsEqual(prevProps, nextProps) {
89
67
  return prevProps.title === nextProps.title && prevProps.value === nextProps.value;
90
68
  };
91
-
92
69
  var _default = (0, _styles.withStyles)(_styles2.default, {
93
70
  name: "HvChartSingleTooltip"
94
71
  })( /*#__PURE__*/(0, _react.memo)(SingleTooltip, arePropsEqual));
95
-
96
72
  exports.default = _default;
97
73
  //# sourceMappingURL=SingleTooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SingleTooltip.js","names":["SingleTooltip","classes","title","value","root","separator","propTypes","PropTypes","shape","string","isRequired","number","arePropsEqual","prevProps","nextProps","withStyles","styles","name","memo"],"sources":["../../../../src/Chart/Tooltip/SingleTooltip/SingleTooltip.js"],"sourcesContent":["import React, { memo } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport styles from \"./styles\";\n\nconst SingleTooltip = ({ classes, title, value }) => (\n <div className={classes.root}>\n <div>\n <HvTypography variant=\"highlightText\">{title}</HvTypography>\n </div>\n <div className={classes.separator} />\n <div>\n <HvTypography>{value}</HvTypography>\n </div>\n </div>\n);\n\nSingleTooltip.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the separator between title and value.\n */\n separator: PropTypes.string,\n }).isRequired,\n /**\n * Title of the chart.\n */\n title: PropTypes.string.isRequired,\n /**\n * Value of the chart.\n */\n value: PropTypes.number.isRequired,\n};\n\nconst arePropsEqual = (prevProps, nextProps) =>\n prevProps.title === nextProps.title && prevProps.value === nextProps.value;\n\nexport default withStyles(styles, { name: \"HvChartSingleTooltip\" })(\n memo(SingleTooltip, arePropsEqual)\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB;EAAA,IAAGC,OAAH,QAAGA,OAAH;EAAA,IAAYC,KAAZ,QAAYA,KAAZ;EAAA,IAAmBC,KAAnB,QAAmBA,KAAnB;EAAA,oBACpB;IAAK,SAAS,EAAEF,OAAO,CAACG,IAAxB;IAAA,wBACE;MAAA,uBACE,qBAAC,4BAAD;QAAc,OAAO,EAAC,eAAtB;QAAA,UAAuCF;MAAvC;IADF,EADF,eAIE;MAAK,SAAS,EAAED,OAAO,CAACI;IAAxB,EAJF,eAKE;MAAA,uBACE,qBAAC,4BAAD;QAAA,UAAeF;MAAf;IADF,EALF;EAAA,EADoB;AAAA,CAAtB;;AAYA,wCAAAH,aAAa,CAACM,SAAd,GAA0B;EACxB;AACF;AACA;EACEL,OAAO,EAAEM,kBAAA,CAAUC,KAAV,CAAgB;IACvB;AACJ;AACA;IACIJ,IAAI,EAAEG,kBAAA,CAAUE,MAJO;;IAKvB;AACJ;AACA;IACIJ,SAAS,EAAEE,kBAAA,CAAUE;EARE,CAAhB,EASNC,UAbqB;;EAcxB;AACF;AACA;EACER,KAAK,EAAEK,kBAAA,CAAUE,MAAV,CAAiBC,UAjBA;;EAkBxB;AACF;AACA;EACEP,KAAK,EAAEI,kBAAA,CAAUI,MAAV,CAAiBD;AArBA,CAA1B;;AAwBA,IAAME,aAAa,GAAG,SAAhBA,aAAgB,CAACC,SAAD,EAAYC,SAAZ;EAAA,OACpBD,SAAS,CAACX,KAAV,KAAoBY,SAAS,CAACZ,KAA9B,IAAuCW,SAAS,CAACV,KAAV,KAAoBW,SAAS,CAACX,KADjD;AAAA,CAAtB;;eAGe,IAAAY,kBAAA,EAAWC,gBAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,gBACb,IAAAC,WAAA,EAAKlB,aAAL,EAAoBY,aAApB,CADa,C"}
1
+ {"version":3,"file":"SingleTooltip.js","names":["SingleTooltip","classes","title","value","root","separator","propTypes","PropTypes","shape","string","isRequired","number","arePropsEqual","prevProps","nextProps","withStyles","styles","name","memo"],"sources":["../../../../src/Chart/Tooltip/SingleTooltip/SingleTooltip.js"],"sourcesContent":["import React, { memo } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport styles from \"./styles\";\n\nconst SingleTooltip = ({ classes, title, value }) => (\n <div className={classes.root}>\n <div>\n <HvTypography variant=\"highlightText\">{title}</HvTypography>\n </div>\n <div className={classes.separator} />\n <div>\n <HvTypography>{value}</HvTypography>\n </div>\n </div>\n);\n\nSingleTooltip.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the separator between title and value.\n */\n separator: PropTypes.string,\n }).isRequired,\n /**\n * Title of the chart.\n */\n title: PropTypes.string.isRequired,\n /**\n * Value of the chart.\n */\n value: PropTypes.number.isRequired,\n};\n\nconst arePropsEqual = (prevProps, nextProps) =>\n prevProps.title === nextProps.title && prevProps.value === nextProps.value;\n\nexport default withStyles(styles, { name: \"HvCh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 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -11,6 +10,5 @@ Object.defineProperty(exports, "default", {
11
10
  return _SingleTooltip.default;
12
11
  }
13
12
  });
14
-
15
13
  var _SingleTooltip = _interopRequireDefault(require("./SingleTooltip"));
16
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/Chart/Tooltip/SingleTooltip/index.js"],"sourcesContent":["export { default } from \"./SingleTooltip\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/Chart/Tooltip/SingleTooltip/index.js"],"sourcesContent":["export { default } from \"./SingleTooltip\";\n"],"mappings":";;;;;;;;;;;;AAAA"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var styles = function styles(theme) {
9
8
  return {
10
9
  root: {
@@ -20,7 +19,6 @@ var styles = function styles(theme) {
20
19
  }
21
20
  };
22
21
  };
23
-
24
22
  var _default = styles;
25
23
  exports.default = _default;
26
24
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["styles","theme","root","padding","hv","spacing","sm","display","backgroundColor","palette","atmosphere","atmo1","boxShadow","shadows","width","zIndex","separator","xs"],"sources":["../../../../src/Chart/Tooltip/SingleTooltip/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n padding: theme.hv.spacing.sm,\n display: \"flex\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n boxShadow: theme.hv.shadows[1],\n width: \"fit-content\",\n zIndex: 100,\n },\n separator: {\n width: theme.hv.spacing.xs,\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;EAAA,OAAY;IACzBC,IAAI,EAAE;MACJC,OAAO,EAAEF,KAAK,CAACG,EAAN,CAASC,OAAT,CAAiBC,EADtB;MAEJC,OAAO,EAAE,MAFL;MAGJC,eAAe,EAAEP,KAAK,CAACG,EAAN,CAASK,OAAT,CAAiBC,UAAjB,CAA4BC,KAHzC;MAIJC,SAAS,EAAEX,KAAK,CAACG,EAAN,CAASS,OAAT,CAAiB,CAAjB,CAJP;MAKJC,KAAK,EAAE,aALH;MAMJC,MAAM,EAAE;IANJ,CADmB;IASzBC,SAAS,EAAE;MACTF,KAAK,EAAEb,KAAK,CAACG,EAAN,CAASC,OAAT,CAAiBY;IADf;EATc,CAAZ;AAAA,CAAf;;eAcejB,M"}
1
+ {"version":3,"file":"styles.js","names":["styles","theme","root","padding","hv","spacing","sm","display","backgroundColor","palette","atmosphere","atmo1","boxShadow","shadows","width","zIndex","separator","xs"],"sources":["../../../../src/Chart/Tooltip/SingleTooltip/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n padding: theme.hv.spacing.sm,\n display: \"flex\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n boxShadow: theme.hv.shadows[1],\n width: \"fit-content\",\n zIndex: 100,\n },\n separator: {\n width: theme.hv.spacing.xs,\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;AAAA,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAIC,KAAK;EAAA,OAAM;IACzBC,IAAI,EAAE;MACJC,OAAO,EAAEF,KAAK,CAACG,EAAE,CAACC,OAAO,CAACC,EAAE;MAC5BC,OAAO,EAAE,MAAM;MACfC,eAAe,EAAEP,KAAK,CAACG,EAAE,CAACK,OAAO,CAACC,UAAU,CAACC,KAAK;MAClDC,SAAS,EAAEX,KAAK,CAACG,EAAE,CAACS,OAAO,CAAC,CAAC,CAAC;MAC9BC,KAAK,EAAE,aAAa;MACpBC,MAAM,EAAE;IACV,CAAC;IACDC,SAAS,EAAE;MACTF,KAAK,EAAEb,KAAK,CAACG,EAAE,CAACC,OAAO,CAACY;IAC1B;EACF,CAAC;AAAA,CAAC;AAAC,eAEYjB,MAAM;AAAA"}
@@ -1,85 +1,61 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.array.iterator.js");
4
-
5
4
  require("core-js/modules/es.object.to-string.js");
6
-
7
5
  require("core-js/modules/es.string.iterator.js");
8
-
9
6
  require("core-js/modules/es.weak-map.js");
10
-
11
7
  require("core-js/modules/web.dom-collections.iterator.js");
12
-
13
8
  require("core-js/modules/es.object.get-own-property-descriptor.js");
14
-
15
9
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
16
-
17
10
  var _typeof = require("@babel/runtime/helpers/typeof");
18
-
19
11
  Object.defineProperty(exports, "__esModule", {
20
12
  value: true
21
13
  });
22
14
  exports.default = void 0;
23
-
24
15
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
25
-
26
16
  var _react = _interopRequireWildcard(require("react"));
27
-
28
17
  var _propTypes = _interopRequireDefault(require("prop-types"));
29
-
30
18
  var _styles = require("@mui/styles");
31
-
32
19
  var _SingleTooltip = _interopRequireDefault(require("./SingleTooltip"));
33
-
34
20
  var _MultiTooltip = _interopRequireDefault(require("./MultiTooltip"));
35
-
36
21
  var _styles2 = _interopRequireDefault(require("./styles"));
37
-
38
22
  var _jsxRuntime = require("react/jsx-runtime");
39
-
40
23
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
41
-
42
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
43
-
44
25
  var offset = 20;
26
+
45
27
  /**
46
28
  * Component responsible for deciding which tooltip should be use and to calculate
47
29
  * the exact position where it should be render.
48
30
  */
49
-
50
31
  var MainToolTip = function MainToolTip(_ref) {
51
32
  var _MultipleTooltip;
52
-
53
33
  var classes = _ref.classes,
54
- coordinates = _ref.coordinates,
55
- data = _ref.data,
56
- useSingle = _ref.useSingle,
57
- tooltip = _ref.tooltip;
34
+ coordinates = _ref.coordinates,
35
+ data = _ref.data,
36
+ useSingle = _ref.useSingle,
37
+ tooltip = _ref.tooltip;
58
38
  var x = coordinates.x,
59
- y = coordinates.y;
60
-
39
+ y = coordinates.y;
61
40
  var _useState = (0, _react.useState)({
62
- left: x,
63
- top: y,
64
- visibility: "hidden"
65
- }),
66
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
67
- style = _useState2[0],
68
- setStyle = _useState2[1];
69
-
41
+ left: x,
42
+ top: y,
43
+ visibility: "hidden"
44
+ }),
45
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
46
+ style = _useState2[0],
47
+ setStyle = _useState2[1];
70
48
  var ref = (0, _react.useRef)(null);
49
+
71
50
  /**
72
51
  * Calculate the position where the tooltip has to render, having in account
73
52
  * the dimensions.
74
53
  */
75
-
76
54
  (0, _react.useEffect)(function () {
77
55
  if (!ref.current || !ref.current.getBoundingClientRect().width) return;
78
-
79
56
  var _ref$current$getBound = ref.current.getBoundingClientRect(),
80
- width = _ref$current$getBound.width,
81
- height = _ref$current$getBound.height;
82
-
57
+ width = _ref$current$getBound.width,
58
+ height = _ref$current$getBound.height;
83
59
  setStyle({
84
60
  left: x - width / 2,
85
61
  top: y - height - offset
@@ -102,7 +78,6 @@ var MainToolTip = function MainToolTip(_ref) {
102
78
  children: renderTooltip(tooltip)
103
79
  });
104
80
  };
105
-
106
81
  process.env.NODE_ENV !== "production" ? MainToolTip.propTypes = {
107
82
  /**
108
83
  * A Jss Object used to override or extend the styles applied.
@@ -113,7 +88,6 @@ process.env.NODE_ENV !== "production" ? MainToolTip.propTypes = {
113
88
  */
114
89
  root: _propTypes.default.string
115
90
  }).isRequired,
116
-
117
91
  /**
118
92
  * Data of the tooltip.
119
93
  */
@@ -122,7 +96,6 @@ process.env.NODE_ENV !== "production" ? MainToolTip.propTypes = {
122
96
  * Title.
123
97
  */
124
98
  title: _propTypes.default.string,
125
-
126
99
  /**
127
100
  * Values of the tooltip.
128
101
  */
@@ -131,19 +104,16 @@ process.env.NODE_ENV !== "production" ? MainToolTip.propTypes = {
131
104
  * Color of the bar.
132
105
  */
133
106
  color: _propTypes.default.string,
134
-
135
107
  /**
136
108
  * Name.
137
109
  */
138
110
  name: _propTypes.default.string,
139
-
140
111
  /**
141
112
  * Value.
142
113
  */
143
114
  value: _propTypes.default.number
144
115
  }))
145
116
  }).isRequired,
146
-
147
117
  /**
148
118
  * Coordinates.
149
119
  */
@@ -152,18 +122,15 @@ process.env.NODE_ENV !== "production" ? MainToolTip.propTypes = {
152
122
  * xx's coordinate.
153
123
  */
154
124
  x: _propTypes.default.number.isRequired,
155
-
156
125
  /**
157
126
  * yy's coordinate.
158
127
  */
159
128
  y: _propTypes.default.number.isRequired
160
129
  }).isRequired,
161
-
162
130
  /**
163
131
  * Defines if should use a single or multiline tooltip.
164
132
  */
165
133
  useSingle: _propTypes.default.bool,
166
-
167
134
  /**
168
135
  * Custom tooltip element to be displayed
169
136
  */
@@ -172,10 +139,8 @@ process.env.NODE_ENV !== "production" ? MainToolTip.propTypes = {
172
139
  MainToolTip.defaultProps = {
173
140
  useSingle: false
174
141
  };
175
-
176
142
  var _default = (0, _styles.withStyles)(_styles2.default, {
177
143
  name: "HvChartTooltip"
178
144
  })(MainToolTip);
179
-
180
145
  exports.default = _default;
181
146
  //# sourceMappingURL=Tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","names":["offset","MainToolTip","classes","coordinates","data","useSingle","tooltip","x","y","useState","left","top","visibility","style","setStyle","ref","useRef","useEffect","current","getBoundingClientRect","width","height","renderTooltip","useCallback","CustomTooltip","title","elements","value","root","propTypes","PropTypes","shape","string","isRequired","arrayOf","color","name","number","bool","func","defaultProps","withStyles","styles"],"sources":["../../../src/Chart/Tooltip/Tooltip.js"],"sourcesContent":["import React, { useEffect, useRef, useState, useCallback } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport SingleTooltip from \"./SingleTooltip\";\nimport MultipleTooltip from \"./MultiTooltip\";\nimport styles from \"./styles\";\n\nconst offset = 20;\n\n/**\n * Component responsible for deciding which tooltip should be use and to calculate\n * the exact position where it should be render.\n */\nconst MainToolTip = ({ classes, coordinates, data, useSingle, tooltip }) => {\n const { x, y } = coordinates;\n const [style, setStyle] = useState({ left: x, top: y, visibility: \"hidden\" });\n const ref = useRef(null);\n\n /**\n * Calculate the position where the tooltip has to render, having in account\n * the dimensions.\n */\n useEffect(() => {\n if (!ref.current || !ref.current.getBoundingClientRect().width) return;\n\n const { width, height } = ref.current.getBoundingClientRect();\n\n setStyle({ left: x - width / 2, top: y - height - offset });\n }, [x, y]);\n\n const renderTooltip = useCallback(\n (CustomTooltip) => {\n if (CustomTooltip) return CustomTooltip(data);\n if (useSingle) return <SingleTooltip title={data.title} value={data.elements[0].value} />;\n return <MultipleTooltip data={data} />;\n },\n [data, useSingle]\n );\n\n return (\n <div ref={ref} className={classes.root} style={style}>\n {renderTooltip(tooltip)}\n </div>\n );\n};\n\nMainToolTip.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the barchart root class.\n */\n root: PropTypes.string,\n }).isRequired,\n /**\n * Data of the tooltip.\n */\n data: PropTypes.shape({\n /**\n * Title.\n */\n title: PropTypes.string,\n /**\n * Values of the tooltip.\n */\n elements: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Color of the bar.\n */\n color: PropTypes.string,\n /**\n * Name.\n */\n name: PropTypes.string,\n /**\n * Value.\n */\n value: PropTypes.number,\n })\n ),\n }).isRequired,\n /**\n * Coordinates.\n */\n coordinates: PropTypes.shape({\n /**\n * xx's coordinate.\n */\n x: PropTypes.number.isRequired,\n /**\n * yy's coordinate.\n */\n y: PropTypes.number.isRequired,\n }).isRequired,\n /**\n * Defines if should use a single or multiline tooltip.\n */\n useSingle: PropTypes.bool,\n /**\n * Custom tooltip element to be displayed\n */\n tooltip: PropTypes.func,\n};\n\nMainToolTip.defaultProps = {\n useSingle: false,\n};\n\nexport default withStyles(styles, { name: \"HvChartTooltip\" })(MainToolTip);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,MAAM,GAAG,EAAf;AAEA;AACA;AACA;AACA;;AACA,IAAMC,WAAW,GAAG,SAAdA,WAAc,OAAwD;EAAA;;EAAA,IAArDC,OAAqD,QAArDA,OAAqD;EAAA,IAA5CC,WAA4C,QAA5CA,WAA4C;EAAA,IAA/BC,IAA+B,QAA/BA,IAA+B;EAAA,IAAzBC,SAAyB,QAAzBA,SAAyB;EAAA,IAAdC,OAAc,QAAdA,OAAc;EAC1E,IAAQC,CAAR,GAAiBJ,WAAjB,CAAQI,CAAR;EAAA,IAAWC,CAAX,GAAiBL,WAAjB,CAAWK,CAAX;;EACA,gBAA0B,IAAAC,eAAA,EAAS;IAAEC,IAAI,EAAEH,CAAR;IAAWI,GAAG,EAAEH,CAAhB;IAAmBI,UAAU,EAAE;EAA/B,CAAT,CAA1B;EAAA;EAAA,IAAOC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B;IACvB;AACJ;AACA;IACIH,IAAI,EAAEE,kBAAA,CAAUE;EAJO,CAAhB,EAKNC,UATmB;;EAUtB;AACF;AACA;EACE7B,IAAI,EAAE0B,kBAAA,CAAUC,KAAV,CAAgB;IACpB;AACJ;AACA;IACIN,KAAK,EAAEK,kBAAA,CAAUE,MAJG;;IAKpB;AACJ;AACA;IACIN,QAAQ,EAAEI,kBAAA,CAAUI,OAAV,CACRJ,kBAAA,CAAUC,KAAV,CAAgB;MACd;AACR;AACA;MACQI,KAAK,EAAEL,kBAAA,CAAUE,MAJH;;MAKd;AACR;AACA;MACQI,IAAI,EAAEN,kBAAA,CAAUE,MARF;;MASd;AACR;AACA;MACQL,KAAK,EAAEG,kBAAA,CAAUO;IAZH,CAAhB,CADQ;EARU,CAAhB,EAwBHJ,UArCmB;;EAsCtB;AACF;AACA;EACE9B,WAAW,EAAE2B,kBAAA,CAAUC,KAAV,CAAgB;IAC3B;AACJ;AACA;IACIxB,CAAC,EAAEuB,kBAAA,CAAUO,MAAV,CAAiBJ,UAJO;;IAK3B;AACJ;AACA;IACIzB,CAAC,EAAEsB,kBAAA,CAAUO,MAAV,CAAiBJ;EARO,CAAhB,EASVA,UAlDmB;;EAmDtB;AACF;AACA;EACE5B,SAAS,EAAEyB,kBAAA,CAAUQ,IAtDC;;EAuDtB;AACF;AACA;EACEhC,OAAO,EAAEwB,kBAAA,CAAUS;AA1DG,CAAxB;AA6DAtC,WAAW,CAACuC,YAAZ,GAA2B;EACzBnC,SAAS,EAAE;AADc,CAA3B;;eAIe,IAAAoC,kBAAA,EAAWC,gBAAX,EAAmB;EAAEN,IAAI,EAAE;AAAR,CAAnB,EAA+CnC,WAA/C,C"}
1
+ {"version":3,"file":"Tooltip.js","names":["offset","MainToolTip","classes","coordinates","data","useSingle","tooltip","x","y","useState","left","top","visibility","style","setStyle","ref","useRef","useEffect","current","getBoundingClientRect","width","height","renderTooltip","useCallback","CustomTooltip","title","elements","value","root","propTypes","PropTypes","shape","string","isRequired","arrayOf","color","name","number","bool","func","defaultProps","withStyles","styles"],"sources":["../../../src/Chart/Tooltip/Tooltip.js"],"sourcesContent":["import React, { useEffect, useRef, useState, useCallback } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport SingleTooltip from \"./SingleTooltip\";\nimport MultipleTooltip from \"./MultiTooltip\";\nimport styles from \"./styles\";\n\nconst offset = 20;\n\n/**\n * Component responsible for deciding which tooltip should be use and to calculate\n * the exact position where it should be render.\n */\nconst MainToolTip = ({ classes, coordinates, data, useSingle, tooltip }) => {\n const { x, y } = coordinates;\n const [style, setStyle] = useState({ left: x, top: y, visibility: \"hidden\" });\n const ref = useRef(null);\n\n /**\n * Calculate the position where the tooltip has to render, having in account\n * the dimensions.\n */\n useEffect(() => {\n if (!ref.current || !ref.current.getBoundingClientRect().width) return;\n\n const { width, height } = ref.current.getBoundingClientRect();\n\n setStyle({ left: x - width / 2, top: y - height - offset });\n }, [x, y]);\n\n const renderTooltip = useCallback(\n (CustomTooltip) => {\n if (CustomTooltip) return CustomTooltip(data);\n if (useSingle) return <SingleTooltip title={data.title} value={data.elements[0].value} />;\n return <MultipleTooltip data={data} />;\n },\n [data, useSingle]\n );\n\n return (\n <div ref={ref} className={classes.root} style={style}>\n {renderTooltip(tooltip)}\n </div>\n );\n};\n\nMainToolTip.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the barchart root class.\n */\n root: PropTypes.string,\n }).isRequired,\n /**\n * Data of the tooltip.\n */\n data: PropTypes.shape({\n /**\n * Title.\n */\n title: PropTypes.string,\n /**\n * Values of the tooltip.\n */\n elements: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Color of the bar.\n */\n color: PropTypes.string,\n /**\n * Name.\n */\n name: PropTypes.string,\n /**\n * Value.\n */\n value: PropTypes.number,\n })\n ),\n }).isRequired,\n /**\n * Coordinates.\n */\n coordinates: PropTypes.shape({\n /**\n * xx's coordinate.\n */\n x: PropTypes.number.isRequired,\n /**\n * yy's coordinate.\n */\n y: PropTypes.number.isRequired,\n }).isRequired,\n /**\n * Defines if should use a single or multiline tooltip.\n */\n useSingle: PropTypes.bool,\n /**\n * Custom tooltip element to be displayed\n */\n tooltip: PropTypes.func,\n};\n\nMainToolTip.defaultProps = {\n useSingle: false,\n};\n\nexport default withStyles(styles, { name: \"HvChartTooltip\" })(MainToolTip);\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAA8B;AAAA;AAAA;AAE9B,IAAMA,MAAM,GAAG,EAAE;;AAEjB;AACA;AACA;AACA;AACA,IAAMC,WAAW,GAAG,SAAdA,WAAW,OAA2D;EAAA;EAAA,IAArDC,OAAO,QAAPA,OAAO;IAAEC,WAAW,QAAXA,WAAW;IAAEC,IAAI,QAAJA,IAAI;IAAEC,SAAS,QAATA,SAAS;IAAEC,OAAO,QAAPA,OAAO;EACnE,IAAQC,CAAC,GAAQJ,WAAW,CAApBI,CAAC;IAAEC,CAAC,GAAKL,WAAW,CAAjBK,CAAC;EACZ,gBAA0B,IAAAC,eAAQ,EAAC;MAAEC,IAAI,EAAEH,CAAC;MAAEI,GAAG,EAAEH,CAAC;MAAEI,UAAU,EAAE;IAAS,CAAC,CAAC;IAAA;IAAtEC,KAAK;IAAEC,QAAQ;EACtB,IAAMC,GAAG,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;;EAExB;AACF;AACA;AACA;EACE,IAAAC,gBAAS,EAAC,YAAM;IACd,IAAI,CAACF,GAAG,CAACG,OAAO,IAAI,CAACH,GAAG,CAACG,OAAO,CAACC,qBAAqB,EAAE,CAACC,KAAK,EAAE;IAEhE,4BAA0BL,GAAG,CAACG,OAAO,CAACC,qBAAqB,EAAE;MAArDC,KAAK,yBAALA,KAAK;MAAEC,MAAM,yBAANA,MAAM;IAErBP,QAAQ,CAAC;MAAEJ,IAAI,EAAEH,CAAC,GAAGa,KAAK,GAAG,CAA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AC,CAAC;EAEN,CAAC,CAAC,CAACJ,UAAU;EACb;AACF;AACA;EACE9B,WAAW,EAAE2B,kBAAS,CAACC,KAAK,CAAC;IAC3B;AACJ;AACA;IACIxB,CAAC,EAAEuB,kBAAS,CAACO,MAAM,CAACJ,UAAU;IAC9B;AACJ;AACA;IACIzB,CAAC,EAAEsB,kBAAS,CAACO,MAAM,CAACJ;EACtB,CAAC,CAAC,CAACA,UAAU;EACb;AACF;AACA;EACE5B,SAAS,EAAEyB,kBAAS,CAACQ,IAAI;EACzB;AACF;AACA;EACEhC,OAAO,EAAEwB,kBAAS,CAACS;AACrB,CAAC;AAEDtC,WAAW,CAACuC,YAAY,GAAG;EACzBnC,SAAS,EAAE;AACb,CAAC;AAAC,eAEa,IAAAoC,kBAAU,EAACC,gBAAM,EAAE;EAAEN,IAAI,EAAE;AAAiB,CAAC,CAAC,CAACnC,WAAW,CAAC;AAAA"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -11,6 +10,5 @@ Object.defineProperty(exports, "default", {
11
10
  return _Tooltip.default;
12
11
  }
13
12
  });
14
-
15
13
  var _Tooltip = _interopRequireDefault(require("./Tooltip"));
16
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/Chart/Tooltip/index.js"],"sourcesContent":["export { default } from \"./Tooltip\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/Chart/Tooltip/index.js"],"sourcesContent":["export { default } from \"./Tooltip\";\n"],"mappings":";;;;;;;;;;;;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["styles","root","position","zIndex","pointerEvents"],"sources":["../../../src/Chart/Tooltip/styles.js"],"sourcesContent":["const styles = {\n root: {\n position: \"fixed\",\n zIndex: 100,\n pointerEvents: \"none\",\n },\n};\n\nexport default styles;\n"],"mappings":";;;;;;AAAA,IAAMA,MAAM,GAAG;EACbC,IAAI,EAAE;IACJC,QAAQ,EAAE,OADN;IAEJC,MAAM,EAAE,GAFJ;IAGJC,aAAa,EAAE;EAHX;AADO,CAAf;eAQeJ,M"}
1
+ {"version":3,"file":"styles.js","names":["styles","root","position","zIndex","pointerEvents"],"sources":["../../../src/Chart/Tooltip/styles.js"],"sourcesContent":["const styles = {\n root: {\n position: \"fixed\",\n zIndex: 100,\n pointerEvents: \"none\",\n },\n};\n\nexport default styles;\n"],"mappings":";;;;;;AAAA,IAAMA,MAAM,GAAG;EACbC,IAAI,EAAE;IACJC,QAAQ,EAAE,OAAO;IACjBC,MAAM,EAAE,GAAG;IACXC,aAAa,EAAE;EACjB;AACF,CAAC;AAAC,eAEaJ,MAAM;AAAA"}
@@ -1,48 +1,33 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.object.keys.js");
4
-
5
4
  require("core-js/modules/es.symbol.js");
6
-
7
5
  require("core-js/modules/es.array.filter.js");
8
-
9
6
  require("core-js/modules/es.object.to-string.js");
10
-
11
7
  require("core-js/modules/es.object.get-own-property-descriptor.js");
12
-
13
8
  require("core-js/modules/web.dom-collections.for-each.js");
14
-
15
9
  require("core-js/modules/es.object.get-own-property-descriptors.js");
16
-
17
10
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
18
-
19
11
  Object.defineProperty(exports, "__esModule", {
20
12
  value: true
21
13
  });
22
14
  exports.applyLayoutDefaults = exports.applyConfigDefaults = void 0;
23
-
24
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
-
26
16
  require("core-js/modules/es.object.values.js");
27
-
28
17
  var _styles = _interopRequireDefault(require("./styles"));
29
-
30
18
  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; }
31
-
32
19
  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) { (0, _defineProperty2.default)(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; }
33
-
34
20
  var setterIfNil = function setterIfNil(object, property, value) {
35
21
  var _object$property;
36
-
37
22
  // eslint-disable-next-line no-param-reassign
38
23
  object[property] = (_object$property = object[property]) !== null && _object$property !== void 0 ? _object$property : value;
39
24
  };
25
+
40
26
  /**
41
27
  * Auxiliary functions to set the layout in order to follow the DS guideline.
42
28
  *
43
29
  */
44
30
 
45
-
46
31
  var applyLayoutYaxisDefaults = function applyLayoutYaxisDefaults(inputLayout, layoutStyles, yAxisTitle, isHorizontal) {
47
32
  var layout = inputLayout;
48
33
  setterIfNil(layout, "yaxis", {});
@@ -66,16 +51,13 @@ var applyLayoutYaxisDefaults = function applyLayoutYaxisDefaults(inputLayout, la
66
51
  setterIfNil(layout.yaxis, "linecolor", layoutStyles.lineColor);
67
52
  setterIfNil(layout.yaxis, "linewidth", 1);
68
53
  setterIfNil(layout.yaxis, "zeroline", false);
69
-
70
54
  if (yAxisTitle) {
71
55
  setterIfNil(layout, "yaxis", {});
72
56
  setterIfNil(layout.yaxis, "title", {});
73
57
  setterIfNil(layout.yaxis.title, "text", yAxisTitle);
74
58
  }
75
-
76
59
  return layout;
77
60
  };
78
-
79
61
  var applyLayoutXaxisDefaults = function applyLayoutXaxisDefaults(inputLayout, layoutStyles, xAxisTitle, isHorizontal) {
80
62
  var layout = inputLayout;
81
63
  setterIfNil(layout, "xaxis", {});
@@ -99,16 +81,13 @@ var applyLayoutXaxisDefaults = function applyLayoutXaxisDefaults(inputLayout, la
99
81
  setterIfNil(layout.xaxis, "linewidth", 1);
100
82
  setterIfNil(layout.xaxis, "linecolor", layoutStyles.lineColor);
101
83
  setterIfNil(layout.xaxis, "zeroline", false);
102
-
103
84
  if (xAxisTitle) {
104
85
  setterIfNil(layout, "xaxis", {});
105
86
  setterIfNil(layout.xaxis, "title", {});
106
87
  setterIfNil(layout.xaxis.title, "text", xAxisTitle);
107
88
  }
108
-
109
89
  return layout;
110
90
  };
111
-
112
91
  var applyLayoutLegendDefaults = function applyLayoutLegendDefaults(inputLayout, layoutStyles) {
113
92
  var layout = inputLayout;
114
93
  setterIfNil(layout, "legend", {
@@ -125,7 +104,6 @@ var applyLayoutLegendDefaults = function applyLayoutLegendDefaults(inputLayout,
125
104
  });
126
105
  return layout;
127
106
  };
128
-
129
107
  var applyLayoutRootDefaults = function applyLayoutRootDefaults(inputLayout, layoutStyles) {
130
108
  var layout = inputLayout;
131
109
  setterIfNil(layout, "colorway", Object.values(layoutStyles.defaultColors));
@@ -139,31 +117,29 @@ var applyLayoutRootDefaults = function applyLayoutRootDefaults(inputLayout, layo
139
117
  setterIfNil(layout, "plot_bgcolor", layoutStyles.plotColor);
140
118
  setterIfNil(layout, "paper_bgcolor", layoutStyles.plotColor);
141
119
  };
142
-
143
120
  var applyLayoutDefaults = function applyLayoutDefaults(inputLayout, theme, isHorizontal, xAxisTitle, yAxisTitle) {
144
121
  var layoutStyles = (0, _styles.default)(theme);
122
+ var layout = _objectSpread({}, inputLayout);
145
123
 
146
- var layout = _objectSpread({}, inputLayout); // Layout
147
-
148
-
149
- applyLayoutRootDefaults(layout, layoutStyles); // Legend
124
+ // Layout
125
+ applyLayoutRootDefaults(layout, layoutStyles);
150
126
 
151
- applyLayoutLegendDefaults(layout, layoutStyles); // Xaxis
127
+ // Legend
128
+ applyLayoutLegendDefaults(layout, layoutStyles);
152
129
 
153
- applyLayoutXaxisDefaults(layout, layoutStyles, xAxisTitle, isHorizontal); // Yaxis
130
+ // Xaxis
131
+ applyLayoutXaxisDefaults(layout, layoutStyles, xAxisTitle, isHorizontal);
154
132
 
133
+ // Yaxis
155
134
  applyLayoutYaxisDefaults(layout, layoutStyles, yAxisTitle, isHorizontal);
156
135
  return layout;
157
136
  };
158
-
159
137
  exports.applyLayoutDefaults = applyLayoutDefaults;
160
-
161
138
  var applyConfigDefaults = function applyConfigDefaults(config) {
162
139
  return _objectSpread({
163
140
  responsive: true,
164
141
  displayModeBar: false
165
142
  }, config);
166
143
  };
167
-
168
144
  exports.applyConfigDefaults = applyConfigDefaults;
169
145
  //# sourceMappingURL=chartPlotlyOverrides.js.map