@perses-dev/components 0.8.0 → 0.9.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 (131) hide show
  1. package/dist/Drawer/Drawer.d.ts +3 -4
  2. package/dist/Drawer/Drawer.d.ts.map +1 -1
  3. package/dist/Drawer/Drawer.js +35 -1
  4. package/dist/Drawer/Drawer.js.map +1 -0
  5. package/dist/Drawer/index.js +15 -1
  6. package/dist/Drawer/index.js.map +1 -0
  7. package/dist/EChart.d.ts.map +1 -1
  8. package/dist/EChart.js +142 -1
  9. package/dist/EChart.js.map +1 -0
  10. package/dist/ErrorAlert.js +25 -1
  11. package/dist/ErrorAlert.js.map +1 -0
  12. package/dist/ErrorBoundary.js +16 -1
  13. package/dist/ErrorBoundary.js.map +1 -0
  14. package/dist/GaugeChart/GaugeChart.js +172 -1
  15. package/dist/GaugeChart/GaugeChart.js.map +1 -0
  16. package/dist/GaugeChart/index.js +15 -1
  17. package/dist/GaugeChart/index.js.map +1 -0
  18. package/dist/InfoTooltip/InfoTooltip.js +79 -1
  19. package/dist/InfoTooltip/InfoTooltip.js.map +1 -0
  20. package/dist/InfoTooltip/InfoTooltip.test.js +36 -1
  21. package/dist/InfoTooltip/InfoTooltip.test.js.map +1 -0
  22. package/dist/InfoTooltip/index.js +15 -1
  23. package/dist/InfoTooltip/index.js.map +1 -0
  24. package/dist/LineChart/LineChart.js +198 -1
  25. package/dist/LineChart/LineChart.js.map +1 -0
  26. package/dist/LineChart/index.js +15 -1
  27. package/dist/LineChart/index.js.map +1 -0
  28. package/dist/LineChart/utils.js +63 -1
  29. package/dist/LineChart/utils.js.map +1 -0
  30. package/dist/StatChart/StatChart.js +121 -1
  31. package/dist/StatChart/StatChart.js.map +1 -0
  32. package/dist/StatChart/StatChart.test.js +82 -1
  33. package/dist/StatChart/StatChart.test.js.map +1 -0
  34. package/dist/StatChart/index.js +15 -1
  35. package/dist/StatChart/index.js.map +1 -0
  36. package/dist/TimeRangeSelector/AbsoluteTimePicker.js +175 -1
  37. package/dist/TimeRangeSelector/AbsoluteTimePicker.js.map +1 -0
  38. package/dist/TimeRangeSelector/TimeRangeSelector.js +52 -1
  39. package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -0
  40. package/dist/TimeRangeSelector/index.js +16 -1
  41. package/dist/TimeRangeSelector/index.js.map +1 -0
  42. package/dist/TimeRangeSelector/utils.js +36 -1
  43. package/dist/TimeRangeSelector/utils.js.map +1 -0
  44. package/dist/Tooltip/SeriesInfo.js +143 -1
  45. package/dist/Tooltip/SeriesInfo.js.map +1 -0
  46. package/dist/Tooltip/SeriesMarker.js +33 -1
  47. package/dist/Tooltip/SeriesMarker.js.map +1 -0
  48. package/dist/Tooltip/Tooltip.js +72 -1
  49. package/dist/Tooltip/Tooltip.js.map +1 -0
  50. package/dist/Tooltip/TooltipContent.js +89 -1
  51. package/dist/Tooltip/TooltipContent.js.map +1 -0
  52. package/dist/Tooltip/focused-series.js +108 -1
  53. package/dist/Tooltip/focused-series.js.map +1 -0
  54. package/dist/Tooltip/focused-series.test.js +75 -1
  55. package/dist/Tooltip/focused-series.test.js.map +1 -0
  56. package/dist/Tooltip/index.js +16 -1
  57. package/dist/Tooltip/index.js.map +1 -0
  58. package/dist/Tooltip/tooltip-model.js +80 -1
  59. package/dist/Tooltip/tooltip-model.js.map +1 -0
  60. package/dist/Tooltip/utils.js +46 -1
  61. package/dist/Tooltip/utils.js.map +1 -0
  62. package/dist/cjs/Drawer/Drawer.js +26 -13
  63. package/dist/cjs/Drawer/index.js +16 -17
  64. package/dist/cjs/EChart.js +114 -89
  65. package/dist/cjs/ErrorAlert.js +16 -12
  66. package/dist/cjs/ErrorBoundary.js +10 -6
  67. package/dist/cjs/GaugeChart/GaugeChart.js +90 -57
  68. package/dist/cjs/GaugeChart/index.js +16 -17
  69. package/dist/cjs/InfoTooltip/InfoTooltip.js +90 -33
  70. package/dist/cjs/InfoTooltip/InfoTooltip.test.js +27 -17
  71. package/dist/cjs/InfoTooltip/index.js +16 -17
  72. package/dist/cjs/LineChart/LineChart.js +122 -87
  73. package/dist/cjs/LineChart/index.js +16 -17
  74. package/dist/cjs/LineChart/utils.js +23 -23
  75. package/dist/cjs/StatChart/StatChart.js +107 -46
  76. package/dist/cjs/StatChart/StatChart.test.js +65 -21
  77. package/dist/cjs/StatChart/index.js +16 -17
  78. package/dist/cjs/TimeRangeSelector/AbsoluteTimePicker.js +144 -64
  79. package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +45 -22
  80. package/dist/cjs/TimeRangeSelector/index.js +17 -18
  81. package/dist/cjs/TimeRangeSelector/utils.js +19 -16
  82. package/dist/cjs/Tooltip/SeriesInfo.js +120 -48
  83. package/dist/cjs/Tooltip/SeriesMarker.js +20 -11
  84. package/dist/cjs/Tooltip/Tooltip.js +95 -67
  85. package/dist/cjs/Tooltip/TooltipContent.js +76 -31
  86. package/dist/cjs/Tooltip/focused-series.js +40 -36
  87. package/dist/cjs/Tooltip/focused-series.test.js +36 -16
  88. package/dist/cjs/Tooltip/index.js +17 -18
  89. package/dist/cjs/Tooltip/tooltip-model.js +46 -30
  90. package/dist/cjs/Tooltip/utils.js +13 -16
  91. package/dist/cjs/context/ChartsThemeProvider.js +65 -13
  92. package/dist/cjs/index.js +27 -28
  93. package/dist/cjs/model/graph.js +10 -5
  94. package/dist/cjs/model/index.js +18 -19
  95. package/dist/cjs/model/theme.js +4 -2
  96. package/dist/cjs/model/units.js +68 -51
  97. package/dist/cjs/test/index.js +16 -17
  98. package/dist/cjs/test/render.js +22 -12
  99. package/dist/cjs/test/setup-tests.js +4 -2
  100. package/dist/cjs/utils/combine-sx.js +15 -16
  101. package/dist/cjs/utils/index.js +17 -18
  102. package/dist/cjs/utils/theme-gen.js +64 -55
  103. package/dist/cjs/utils/theme-gen.test.js +14 -12
  104. package/dist/context/ChartsThemeProvider.js +36 -1
  105. package/dist/context/ChartsThemeProvider.js.map +1 -0
  106. package/dist/index.js +26 -1
  107. package/dist/index.js.map +1 -0
  108. package/dist/model/graph.js +15 -1
  109. package/dist/model/graph.js.map +1 -0
  110. package/dist/model/index.js +17 -1
  111. package/dist/model/index.js.map +1 -0
  112. package/dist/model/theme.js +15 -1
  113. package/dist/model/theme.js.map +1 -0
  114. package/dist/model/units.d.ts.map +1 -1
  115. package/dist/model/units.js +196 -1
  116. package/dist/model/units.js.map +1 -0
  117. package/dist/test/index.js +15 -1
  118. package/dist/test/index.js.map +1 -0
  119. package/dist/test/render.js +32 -1
  120. package/dist/test/render.js.map +1 -0
  121. package/dist/test/setup-tests.js +18 -1
  122. package/dist/test/setup-tests.js.map +1 -0
  123. package/dist/utils/combine-sx.js +27 -1
  124. package/dist/utils/combine-sx.js.map +1 -0
  125. package/dist/utils/index.js +16 -1
  126. package/dist/utils/index.js.map +1 -0
  127. package/dist/utils/theme-gen.js +183 -1
  128. package/dist/utils/theme-gen.js.map +1 -0
  129. package/dist/utils/theme-gen.test.js +196 -1
  130. package/dist/utils/theme-gen.test.js.map +1 -0
  131. package/package.json +8 -4
@@ -1,7 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GaugeChart = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
1
  // Copyright 2022 The Perses Authors
6
2
  // Licensed under the Apache License, Version 2.0 (the "License");
7
3
  // you may not use this file except in compliance with the License.
@@ -14,33 +10,50 @@ const jsx_runtime_1 = require("react/jsx-runtime");
14
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
11
  // See the License for the specific language governing permissions and
16
12
  // limitations under the License.
17
- const react_1 = require("react");
18
- const core_1 = require("echarts/core");
19
- const charts_1 = require("echarts/charts");
20
- const components_1 = require("echarts/components");
21
- const renderers_1 = require("echarts/renderers");
22
- const ChartsThemeProvider_1 = require("../context/ChartsThemeProvider");
23
- const units_1 = require("../model/units");
24
- const EChart_1 = require("../EChart");
25
- (0, core_1.use)([charts_1.GaugeChart, components_1.GridComponent, components_1.TitleComponent, components_1.TooltipComponent, renderers_1.CanvasRenderer]);
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "GaugeChart", {
18
+ enumerable: true,
19
+ get: ()=>GaugeChart
20
+ });
21
+ const _jsxRuntime = require("react/jsx-runtime");
22
+ const _react = require("react");
23
+ const _core = require("echarts/core");
24
+ const _charts = require("echarts/charts");
25
+ const _components = require("echarts/components");
26
+ const _renderers = require("echarts/renderers");
27
+ const _chartsThemeProvider = require("../context/ChartsThemeProvider");
28
+ const _units = require("../model/units");
29
+ const _echart = require("../EChart");
30
+ (0, _core.use)([
31
+ _charts.GaugeChart,
32
+ _components.GridComponent,
33
+ _components.TitleComponent,
34
+ _components.TooltipComponent,
35
+ _renderers.CanvasRenderer
36
+ ]);
26
37
  function GaugeChart(props) {
27
- const { width, height, data, unit, axisLine, max } = props;
28
- const chartsTheme = (0, ChartsThemeProvider_1.useChartsTheme)();
29
- const option = (0, react_1.useMemo)(() => {
30
- if (data === null || data === undefined)
31
- return chartsTheme.noDataOption;
38
+ const { width , height , data , unit , axisLine , max } = props;
39
+ const chartsTheme = (0, _chartsThemeProvider.useChartsTheme)();
40
+ const option = (0, _react.useMemo)(()=>{
41
+ if (data === null || data === undefined) return chartsTheme.noDataOption;
32
42
  const calculatedValue = data;
33
43
  return {
34
44
  title: {
35
- show: false,
45
+ show: false
36
46
  },
37
47
  tooltip: {
38
- show: false,
48
+ show: false
39
49
  },
40
50
  series: [
41
51
  {
42
52
  type: 'gauge',
43
- center: ['50%', '65%'],
53
+ center: [
54
+ '50%',
55
+ '65%'
56
+ ],
44
57
  radius: '100%',
45
58
  startAngle: 200,
46
59
  endAngle: -20,
@@ -51,49 +64,57 @@ function GaugeChart(props) {
51
64
  show: true,
52
65
  width: 22,
53
66
  itemStyle: {
54
- color: 'auto',
55
- },
67
+ color: 'auto'
68
+ }
56
69
  },
57
70
  pointer: {
58
- show: false,
71
+ show: false
59
72
  },
60
73
  axisLine: {
61
74
  lineStyle: {
62
- color: [[1, '#e1e5e9']],
63
- width: 22,
64
- },
75
+ color: [
76
+ [
77
+ 1,
78
+ '#e1e5e9'
79
+ ]
80
+ ],
81
+ width: 22
82
+ }
65
83
  },
66
84
  axisTick: {
67
85
  show: false,
68
- distance: 0,
86
+ distance: 0
69
87
  },
70
88
  splitLine: {
71
- show: true,
89
+ show: true
72
90
  },
73
91
  axisLabel: {
74
92
  show: false,
75
93
  distance: -18,
76
94
  color: '#999',
77
- fontSize: 12,
95
+ fontSize: 12
78
96
  },
79
97
  anchor: {
80
- show: false,
98
+ show: false
81
99
  },
82
100
  title: {
83
- show: false,
101
+ show: false
84
102
  },
85
103
  detail: {
86
- show: false,
104
+ show: false
87
105
  },
88
106
  data: [
89
107
  {
90
- value: calculatedValue,
91
- },
92
- ],
108
+ value: calculatedValue
109
+ }
110
+ ]
93
111
  },
94
112
  {
95
113
  type: 'gauge',
96
- center: ['50%', '65%'],
114
+ center: [
115
+ '50%',
116
+ '65%'
117
+ ],
97
118
  radius: '114%',
98
119
  startAngle: 200,
99
120
  endAngle: -20,
@@ -102,44 +123,56 @@ function GaugeChart(props) {
102
123
  pointer: {
103
124
  show: false,
104
125
  itemStyle: {
105
- color: 'auto',
106
- },
126
+ color: 'auto'
127
+ }
107
128
  },
108
129
  axisLine,
109
130
  axisTick: {
110
- show: false,
131
+ show: false
111
132
  },
112
133
  splitLine: {
113
- show: false,
134
+ show: false
114
135
  },
115
136
  axisLabel: {
116
- show: false,
137
+ show: false
117
138
  },
118
139
  detail: {
119
140
  show: true,
120
141
  width: '60%',
121
142
  borderRadius: 8,
122
- offsetCenter: [0, '-9%'],
143
+ offsetCenter: [
144
+ 0,
145
+ '-9%'
146
+ ],
123
147
  color: 'inherit',
124
- formatter: (value) => {
125
- return (0, units_1.formatValue)(value, {
148
+ formatter: (value)=>{
149
+ return (0, _units.formatValue)(value, {
126
150
  kind: unit.kind,
127
- decimal_places: 0,
151
+ decimal_places: 0
128
152
  });
129
- },
153
+ }
130
154
  },
131
155
  data: [
132
156
  {
133
- value: calculatedValue,
134
- },
135
- ],
136
- },
137
- ],
157
+ value: calculatedValue
158
+ }
159
+ ]
160
+ }
161
+ ]
138
162
  };
139
- }, [data, chartsTheme, unit, axisLine, max]);
140
- return ((0, jsx_runtime_1.jsx)(EChart_1.EChart, { sx: {
163
+ }, [
164
+ data,
165
+ chartsTheme,
166
+ unit,
167
+ axisLine,
168
+ max
169
+ ]);
170
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_echart.EChart, {
171
+ sx: {
141
172
  width: width,
142
- height: height,
143
- }, option: option, theme: chartsTheme.themeName }));
173
+ height: height
174
+ },
175
+ option: option,
176
+ theme: chartsTheme.themeName
177
+ });
144
178
  }
145
- exports.GaugeChart = GaugeChart;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // Copyright 2022 The Perses Authors
3
2
  // Licensed under the Apache License, Version 2.0 (the "License");
4
3
  // you may not use this file except in compliance with the License.
@@ -11,19 +10,19 @@
11
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
11
  // See the License for the specific language governing permissions and
13
12
  // limitations under the License.
14
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- var desc = Object.getOwnPropertyDescriptor(m, k);
17
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
- desc = { enumerable: true, get: function() { return m[k]; } };
19
- }
20
- Object.defineProperty(o, k2, desc);
21
- }) : (function(o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- }));
25
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- __exportStar(require("./GaugeChart"), exports);
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ _exportStar(require("./GaugeChart"), exports);
18
+ function _exportStar(from, to) {
19
+ Object.keys(from).forEach(function(k) {
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
+ enumerable: true,
22
+ get: function() {
23
+ return from[k];
24
+ }
25
+ });
26
+ });
27
+ return from;
28
+ }
@@ -1,39 +1,96 @@
1
+ // Copyright 2022 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
1
13
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InfoTooltip = exports.TooltipPlacement = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const material_1 = require("@mui/material");
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ function _export(target, all) {
18
+ for(var name in all)Object.defineProperty(target, name, {
19
+ enumerable: true,
20
+ get: all[name]
21
+ });
22
+ }
23
+ _export(exports, {
24
+ TooltipPlacement: ()=>TooltipPlacement,
25
+ InfoTooltip: ()=>InfoTooltip
26
+ });
27
+ const _jsxRuntime = require("react/jsx-runtime");
28
+ const _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
29
+ const _material = require("@mui/material");
30
+ function _interopRequireDefault(obj) {
31
+ return obj && obj.__esModule ? obj : {
32
+ default: obj
33
+ };
34
+ }
6
35
  var TooltipPlacement;
7
- (function (TooltipPlacement) {
8
- TooltipPlacement["Top"] = "top";
9
- TooltipPlacement["Left"] = "left";
10
- TooltipPlacement["Right"] = "right";
11
- TooltipPlacement["Bottom"] = "bottom";
12
- })(TooltipPlacement = exports.TooltipPlacement || (exports.TooltipPlacement = {}));
13
- const InfoTooltip = ({ id, title, description, placement, children }) => {
14
- return ((0, jsx_runtime_1.jsx)(StyledTooltip, { arrow: true, id: id, placement: placement, title: (0, jsx_runtime_1.jsx)(TooltipContent, { title: title, description: description }), children: (0, jsx_runtime_1.jsx)("div", { children: children }) }));
36
+ (function(TooltipPlacement) {
37
+ TooltipPlacement["Top"] = 'top';
38
+ TooltipPlacement["Left"] = 'left';
39
+ TooltipPlacement["Right"] = 'right';
40
+ TooltipPlacement["Bottom"] = 'bottom';
41
+ })(TooltipPlacement || (TooltipPlacement = {}));
42
+ const InfoTooltip = ({ id , title , description , placement , children })=>{
43
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(StyledTooltip, {
44
+ arrow: true,
45
+ id: id,
46
+ placement: placement,
47
+ title: /*#__PURE__*/ (0, _jsxRuntime.jsx)(TooltipContent, {
48
+ title: title,
49
+ description: description
50
+ }),
51
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
52
+ children: children
53
+ })
54
+ });
15
55
  };
16
- exports.InfoTooltip = InfoTooltip;
17
- const TooltipContent = ({ title, description }) => {
18
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [title && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", sx: (theme) => ({
19
- color: theme.palette.text.primary,
20
- fontWeight: theme.typography.fontWeightMedium,
21
- }), children: title })), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: (theme) => ({
22
- color: theme.palette.text.primary,
23
- }), children: description })] }));
56
+ const TooltipContent = ({ title , description })=>{
57
+ return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
58
+ children: [
59
+ title && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
60
+ variant: "body2",
61
+ sx: (theme)=>({
62
+ color: theme.palette.text.primary,
63
+ fontWeight: theme.typography.fontWeightMedium
64
+ }),
65
+ children: title
66
+ }),
67
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
68
+ variant: "caption",
69
+ sx: (theme)=>({
70
+ color: theme.palette.text.primary
71
+ }),
72
+ children: description
73
+ })
74
+ ]
75
+ });
24
76
  };
25
- const StyledTooltip = (0, material_1.styled)(({ className, ...props }) => ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { ...props, classes: { popper: className } })))(({ theme }) => ({
26
- [`& .${material_1.tooltipClasses.tooltip}`]: {
27
- backgroundColor: theme.palette.secondary.main,
28
- color: theme.palette.grey[900],
29
- maxWidth: '300px',
30
- padding: theme.spacing(1),
31
- boxShadow: theme.shadows[1],
32
- },
33
- [`& .${material_1.tooltipClasses.arrow}`]: {
34
- color: theme.palette.background.paper,
35
- '&::before': {
77
+ const StyledTooltip = (0, _material.styled)(({ className , ...props })=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Tooltip, {
78
+ ...props,
79
+ classes: {
80
+ popper: className
81
+ }
82
+ }))(({ theme })=>({
83
+ [`& .${_material.tooltipClasses.tooltip}`]: {
36
84
  backgroundColor: theme.palette.secondary.main,
85
+ color: theme.palette.grey[900],
86
+ maxWidth: '300px',
87
+ padding: theme.spacing(1),
88
+ boxShadow: theme.shadows[1]
37
89
  },
38
- },
39
- }));
90
+ [`& .${_material.tooltipClasses.arrow}`]: {
91
+ color: theme.palette.background.paper,
92
+ '&::before': {
93
+ backgroundColor: theme.palette.secondary.main
94
+ }
95
+ }
96
+ }));
@@ -1,9 +1,3 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const jsx_runtime_1 = require("react/jsx-runtime");
7
1
  // Copyright 2022 The Perses Authors
8
2
  // Licensed under the Apache License, Version 2.0 (the "License");
9
3
  // you may not use this file except in compliance with the License.
@@ -16,18 +10,34 @@ const jsx_runtime_1 = require("react/jsx-runtime");
16
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
11
  // See the License for the specific language governing permissions and
18
12
  // limitations under the License.
19
- const react_1 = require("@testing-library/react");
20
- const user_event_1 = __importDefault(require("@testing-library/user-event"));
21
- const dom_1 = require("@testing-library/dom");
22
- const InfoTooltip_1 = require("./InfoTooltip");
23
- describe('InfoTooltip', () => {
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ const _jsxRuntime = require("react/jsx-runtime");
18
+ const _react = require("@testing-library/react");
19
+ const _userEvent = /*#__PURE__*/ _interopRequireDefault(require("@testing-library/user-event"));
20
+ const _dom = require("@testing-library/dom");
21
+ const _infoTooltip = require("./InfoTooltip");
22
+ function _interopRequireDefault(obj) {
23
+ return obj && obj.__esModule ? obj : {
24
+ default: obj
25
+ };
26
+ }
27
+ describe('InfoTooltip', ()=>{
24
28
  const title = 'Tooltip Title';
25
29
  const description = 'this is a tooltip';
26
- it('should render title and description', async () => {
27
- (0, react_1.render)((0, jsx_runtime_1.jsx)(InfoTooltip_1.InfoTooltip, { title: title, description: description, children: (0, jsx_runtime_1.jsx)("div", { children: "tooltipAnchor" }) }));
28
- const tooltipAnchor = dom_1.screen.getByText('tooltipAnchor');
29
- user_event_1.default.hover(tooltipAnchor);
30
- await dom_1.screen.findByText(title);
31
- dom_1.screen.findByText(description);
30
+ it('should render title and description', async ()=>{
31
+ (0, _react.render)(/*#__PURE__*/ (0, _jsxRuntime.jsx)(_infoTooltip.InfoTooltip, {
32
+ title: title,
33
+ description: description,
34
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
35
+ children: "tooltipAnchor"
36
+ })
37
+ }));
38
+ const tooltipAnchor = _dom.screen.getByText('tooltipAnchor');
39
+ _userEvent.default.hover(tooltipAnchor);
40
+ await _dom.screen.findByText(title);
41
+ _dom.screen.findByText(description);
32
42
  });
33
43
  });
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  // Copyright 2022 The Perses Authors
3
2
  // Licensed under the Apache License, Version 2.0 (the "License");
4
3
  // you may not use this file except in compliance with the License.
@@ -11,19 +10,19 @@
11
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
11
  // See the License for the specific language governing permissions and
13
12
  // limitations under the License.
14
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- var desc = Object.getOwnPropertyDescriptor(m, k);
17
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
- desc = { enumerable: true, get: function() { return m[k]; } };
19
- }
20
- Object.defineProperty(o, k2, desc);
21
- }) : (function(o, m, k, k2) {
22
- if (k2 === undefined) k2 = k;
23
- o[k2] = m[k];
24
- }));
25
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- __exportStar(require("./InfoTooltip"), exports);
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ _exportStar(require("./InfoTooltip"), exports);
18
+ function _exportStar(from, to) {
19
+ Object.keys(from).forEach(function(k) {
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
+ enumerable: true,
22
+ get: function() {
23
+ return from[k];
24
+ }
25
+ });
26
+ });
27
+ return from;
28
+ }