@perses-dev/timeseries-table-plugin 0.12.0 → 0.13.0-beta.2

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 (146) hide show
  1. package/__mf/js/{TimeSeriesTable.a46d4c0c.js → TimeSeriesTable.306f8f49.js} +3 -3
  2. package/__mf/js/async/1522.c207deed.js +22 -0
  3. package/__mf/js/async/1616.2eecb24c.js +1 -0
  4. package/__mf/js/async/1915.483e1629.js +37 -0
  5. package/__mf/js/async/2043.3868224e.js +2 -0
  6. package/__mf/js/async/2266.219b7a42.js +1 -0
  7. package/__mf/js/async/2901.7299202e.js +1 -0
  8. package/__mf/js/async/392.e5afbc9f.js +2 -0
  9. package/__mf/js/async/3923.2e6628ef.js +1 -0
  10. package/__mf/js/async/4077.59d693f0.js +1 -0
  11. package/__mf/js/async/4121.91bf4bcc.js +2 -0
  12. package/__mf/js/async/4496.b6247974.js +1 -0
  13. package/__mf/js/async/4647.d4f0a558.js +1 -0
  14. package/__mf/js/async/5002.3e47ae67.js +1 -0
  15. package/__mf/js/async/5071.be72dc35.js +1 -0
  16. package/__mf/js/async/5587.b0e5e14b.js +1 -0
  17. package/__mf/js/async/6157.ae204aed.js +3 -0
  18. package/__mf/js/async/6274.4748d1fc.js +2 -0
  19. package/__mf/js/async/6458.8911babf.js +1 -0
  20. package/__mf/js/async/6465.e08a3883.js +1 -0
  21. package/__mf/js/async/672.13c099dd.js +7 -0
  22. package/__mf/js/async/{589.f808cb6d.js.LICENSE.txt → 672.13c099dd.js.LICENSE.txt} +41 -1
  23. package/__mf/js/async/7028.2a8af948.js +1 -0
  24. package/__mf/js/async/7192.a782922d.js +1 -0
  25. package/__mf/js/async/7633.531c287c.js +2 -0
  26. package/__mf/js/async/7968.1c541836.js +1 -0
  27. package/__mf/js/async/7978.a6164548.js +1 -0
  28. package/__mf/js/async/8356.903dfdcc.js +1 -0
  29. package/__mf/js/async/8470.8828be23.js +2 -0
  30. package/__mf/js/async/873.146dbd48.js +1 -0
  31. package/__mf/js/async/9148.14b32a38.js +1 -0
  32. package/__mf/js/async/9235.87877125.js +1 -0
  33. package/__mf/js/async/941.1550fb5d.js +2 -0
  34. package/__mf/js/async/9588.85235ea3.js +1 -0
  35. package/__mf/js/async/{357.8ed888fe.js → 9736.9653b5a5.js} +7 -6
  36. package/__mf/js/async/__federation_expose_TimeSeriesTable.e4525ca7.js +1 -0
  37. package/__mf/js/async/lib-router.d1eec799.js +2 -0
  38. package/__mf/js/{main.aa88f2d9.js → main.d7039fe9.js} +2 -2
  39. package/lib/TimeSeriesTable.d.ts +3 -3
  40. package/lib/TimeSeriesTable.d.ts.map +1 -1
  41. package/lib/TimeSeriesTable.js +2 -2
  42. package/lib/TimeSeriesTable.js.map +1 -1
  43. package/lib/TimeSeriesTablePanel.d.ts +4 -4
  44. package/lib/TimeSeriesTablePanel.d.ts.map +1 -1
  45. package/lib/TimeSeriesTablePanel.js +3 -3
  46. package/lib/TimeSeriesTablePanel.js.map +1 -1
  47. package/lib/bootstrap.js +2 -2
  48. package/lib/components/DataTable.d.ts +4 -4
  49. package/lib/components/DataTable.d.ts.map +1 -1
  50. package/lib/components/DataTable.js +7 -7
  51. package/lib/components/DataTable.js.map +1 -1
  52. package/lib/components/EmbeddedPanel.d.ts +3 -3
  53. package/lib/components/EmbeddedPanel.d.ts.map +1 -1
  54. package/lib/components/EmbeddedPanel.js +4 -4
  55. package/lib/components/EmbeddedPanel.js.map +1 -1
  56. package/lib/components/SeriesName.d.ts +2 -2
  57. package/lib/components/SeriesName.d.ts.map +1 -1
  58. package/lib/components/SeriesName.js +3 -3
  59. package/lib/components/SeriesName.js.map +1 -1
  60. package/lib/components/TimeSeriesTableItemSelectionActionsEditor.d.ts +2 -2
  61. package/lib/components/TimeSeriesTableItemSelectionActionsEditor.d.ts.map +1 -1
  62. package/lib/components/TimeSeriesTableItemSelectionActionsEditor.js +2 -2
  63. package/lib/components/TimeSeriesTableItemSelectionActionsEditor.js.map +1 -1
  64. package/lib/components/index.js +3 -3
  65. package/lib/components/index.js.map +1 -1
  66. package/lib/getPluginModule.d.ts +1 -1
  67. package/lib/getPluginModule.d.ts.map +1 -1
  68. package/lib/getPluginModule.js +3 -1
  69. package/lib/getPluginModule.js.map +1 -1
  70. package/lib/index-federation.js +1 -1
  71. package/lib/index.js +6 -6
  72. package/lib/index.js.map +1 -1
  73. package/lib/model.d.ts +1 -1
  74. package/lib/model.d.ts.map +1 -1
  75. package/lib/model.js.map +1 -1
  76. package/lib/setup-tests.d.ts +1 -1
  77. package/lib/setup-tests.d.ts.map +1 -1
  78. package/lib/setup-tests.js +2 -2
  79. package/lib/setup-tests.js.map +1 -1
  80. package/lib/test/mock-query-results.d.ts +1 -1
  81. package/lib/test/mock-query-results.d.ts.map +1 -1
  82. package/lib/test/mock-query-results.js.map +1 -1
  83. package/mf-manifest.json +45 -46
  84. package/mf-stats.json +45 -46
  85. package/package.json +11 -11
  86. package/__mf/js/async/121.592e3064.js +0 -2
  87. package/__mf/js/async/177.c119132c.js +0 -1
  88. package/__mf/js/async/187.e7610888.js +0 -7
  89. package/__mf/js/async/187.e7610888.js.LICENSE.txt +0 -39
  90. package/__mf/js/async/192.50958a78.js +0 -1
  91. package/__mf/js/async/2.56628a75.js +0 -1
  92. package/__mf/js/async/235.24837781.js +0 -1
  93. package/__mf/js/async/240.67c2c89e.js +0 -1
  94. package/__mf/js/async/274.65444167.js +0 -2
  95. package/__mf/js/async/356.3bfad7d9.js +0 -1
  96. package/__mf/js/async/392.1ef58718.js +0 -2
  97. package/__mf/js/async/413.06624aa3.js +0 -1
  98. package/__mf/js/async/43.9749b9fd.js +0 -2
  99. package/__mf/js/async/458.621e2d5a.js +0 -1
  100. package/__mf/js/async/470.e310152e.js +0 -2
  101. package/__mf/js/async/546.453f730a.js +0 -3
  102. package/__mf/js/async/558.3509fb4b.js +0 -1
  103. package/__mf/js/async/587.3ce8a0bb.js +0 -1
  104. package/__mf/js/async/588.001b4256.js +0 -1
  105. package/__mf/js/async/589.f808cb6d.js +0 -2
  106. package/__mf/js/async/599.ca81e868.js +0 -2
  107. package/__mf/js/async/603.0e24b840.js +0 -2
  108. package/__mf/js/async/616.0bbea9bc.js +0 -1
  109. package/__mf/js/async/71.70c374bd.js +0 -1
  110. package/__mf/js/async/77.179f6b48.js +0 -1
  111. package/__mf/js/async/842.bc227066.js +0 -1
  112. package/__mf/js/async/873.58804e15.js +0 -1
  113. package/__mf/js/async/939.70679ab8.js +0 -1
  114. package/__mf/js/async/941.4bc4bec7.js +0 -2
  115. package/__mf/js/async/968.96a94ca9.js +0 -1
  116. package/__mf/js/async/978.0065bf35.js +0 -1
  117. package/__mf/js/async/984.894a30f6.js +0 -22
  118. package/__mf/js/async/994.d6948621.js +0 -37
  119. package/__mf/js/async/__federation_expose_TimeSeriesTable.00ffd570.js +0 -1
  120. package/__mf/js/async/lib-router.03790637.js +0 -2
  121. package/lib/cjs/TimeSeriesTable.js +0 -42
  122. package/lib/cjs/TimeSeriesTablePanel.js +0 -44
  123. package/lib/cjs/bootstrap.js +0 -26
  124. package/lib/cjs/components/DataTable.js +0 -333
  125. package/lib/cjs/components/EmbeddedPanel.js +0 -52
  126. package/lib/cjs/components/SeriesName.js +0 -100
  127. package/lib/cjs/components/TimeSeriesTableItemSelectionActionsEditor.js +0 -44
  128. package/lib/cjs/components/index.js +0 -32
  129. package/lib/cjs/env.d.js +0 -14
  130. package/lib/cjs/getPluginModule.js +0 -39
  131. package/lib/cjs/index-federation.js +0 -55
  132. package/lib/cjs/index.js +0 -41
  133. package/lib/cjs/model.js +0 -16
  134. package/lib/cjs/setup-tests.js +0 -19
  135. package/lib/cjs/test/mock-query-results.js +0 -417
  136. /package/__mf/css/async/{187.85c2cbf6.css → 672.85c2cbf6.css} +0 -0
  137. /package/__mf/js/async/{984.894a30f6.js.LICENSE.txt → 1522.c207deed.js.LICENSE.txt} +0 -0
  138. /package/__mf/js/async/{43.9749b9fd.js.LICENSE.txt → 2043.3868224e.js.LICENSE.txt} +0 -0
  139. /package/__mf/js/async/{392.1ef58718.js.LICENSE.txt → 392.e5afbc9f.js.LICENSE.txt} +0 -0
  140. /package/__mf/js/async/{121.592e3064.js.LICENSE.txt → 4121.91bf4bcc.js.LICENSE.txt} +0 -0
  141. /package/__mf/js/async/{274.65444167.js.LICENSE.txt → 6274.4748d1fc.js.LICENSE.txt} +0 -0
  142. /package/__mf/js/async/{603.0e24b840.js.LICENSE.txt → 7633.531c287c.js.LICENSE.txt} +0 -0
  143. /package/__mf/js/async/{470.e310152e.js.LICENSE.txt → 8470.8828be23.js.LICENSE.txt} +0 -0
  144. /package/__mf/js/async/{941.4bc4bec7.js.LICENSE.txt → 941.1550fb5d.js.LICENSE.txt} +0 -0
  145. /package/__mf/js/async/{357.8ed888fe.js.LICENSE.txt → 9736.9653b5a5.js.LICENSE.txt} +0 -0
  146. /package/__mf/js/async/{lib-router.03790637.js.LICENSE.txt → lib-router.d1eec799.js.LICENSE.txt} +0 -0
@@ -10,8 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { TimeSeriesTablePanel } from './TimeSeriesTablePanel';
14
- import { TimeSeriesTableItemSelectionActionsEditor } from './components';
13
+ import { TimeSeriesTableItemSelectionActionsEditor } from "./components/index.js";
14
+ import { TimeSeriesTablePanel } from "./TimeSeriesTablePanel.js";
15
15
  /**
16
16
  * The core TimeSeriesTable panel plugin for Perses.
17
17
  */ export const TimeSeriesTable = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/TimeSeriesTable.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelPlugin } from '@perses-dev/plugin-system';\nimport { TimeSeriesTablePanel, TimeSeriesTableProps } from './TimeSeriesTablePanel';\nimport { TimeSeriesTableItemSelectionActionsEditor } from './components';\nimport { TimeSeriesTableOptions } from './model';\n\n/**\n * The core TimeSeriesTable panel plugin for Perses.\n */\nexport const TimeSeriesTable: PanelPlugin<TimeSeriesTableOptions, TimeSeriesTableProps> = {\n PanelComponent: TimeSeriesTablePanel,\n supportedQueryTypes: ['TimeSeriesQuery'],\n queryOptions: {\n mode: 'instant',\n },\n panelOptionsEditorComponents: [{ label: 'Item Actions', content: TimeSeriesTableItemSelectionActionsEditor }],\n createInitialOptions: () => {\n return {};\n },\n};\n"],"names":["TimeSeriesTablePanel","TimeSeriesTableItemSelectionActionsEditor","TimeSeriesTable","PanelComponent","supportedQueryTypes","queryOptions","mode","panelOptionsEditorComponents","label","content","createInitialOptions"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,oBAAoB,QAA8B,yBAAyB;AACpF,SAASC,yCAAyC,QAAQ,eAAe;AAGzE;;CAEC,GACD,OAAO,MAAMC,kBAA6E;IACxFC,gBAAgBH;IAChBI,qBAAqB;QAAC;KAAkB;IACxCC,cAAc;QACZC,MAAM;IACR;IACAC,8BAA8B;QAAC;YAAEC,OAAO;YAAgBC,SAASR;QAA0C;KAAE;IAC7GS,sBAAsB;QACpB,OAAO,CAAC;IACV;AACF,EAAE"}
1
+ {"version":3,"sources":["../../src/TimeSeriesTable.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { PanelPlugin } from '@perses-dev/plugin-system';\n\nimport { TimeSeriesTableItemSelectionActionsEditor } from './components';\nimport type { TimeSeriesTableOptions } from './model';\nimport type { TimeSeriesTableProps } from './TimeSeriesTablePanel';\nimport { TimeSeriesTablePanel } from './TimeSeriesTablePanel';\n\n/**\n * The core TimeSeriesTable panel plugin for Perses.\n */\nexport const TimeSeriesTable: PanelPlugin<TimeSeriesTableOptions, TimeSeriesTableProps> = {\n PanelComponent: TimeSeriesTablePanel,\n supportedQueryTypes: ['TimeSeriesQuery'],\n queryOptions: {\n mode: 'instant',\n },\n panelOptionsEditorComponents: [{ label: 'Item Actions', content: TimeSeriesTableItemSelectionActionsEditor }],\n createInitialOptions: () => {\n return {};\n },\n};\n"],"names":["TimeSeriesTableItemSelectionActionsEditor","TimeSeriesTablePanel","TimeSeriesTable","PanelComponent","supportedQueryTypes","queryOptions","mode","panelOptionsEditorComponents","label","content","createInitialOptions"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,SAASA,yCAAyC,QAAQ,wBAAe;AAGzE,SAASC,oBAAoB,QAAQ,4BAAyB;AAE9D;;CAEC,GACD,OAAO,MAAMC,kBAA6E;IACxFC,gBAAgBF;IAChBG,qBAAqB;QAAC;KAAkB;IACxCC,cAAc;QACZC,MAAM;IACR;IACAC,8BAA8B;QAAC;YAAEC,OAAO;YAAgBC,SAAST;QAA0C;KAAE;IAC7GU,sBAAsB;QACpB,OAAO,CAAC;IACV;AACF,EAAE"}
@@ -1,7 +1,7 @@
1
- import { ReactElement } from 'react';
2
- import { PanelProps } from '@perses-dev/plugin-system';
3
- import { TimeSeriesData } from '@perses-dev/spec';
4
- import { TimeSeriesTableOptions } from './model';
1
+ import type { PanelProps } from '@perses-dev/plugin-system';
2
+ import type { TimeSeriesData } from '@perses-dev/spec';
3
+ import type { ReactElement } from 'react';
4
+ import type { TimeSeriesTableOptions } from './model';
5
5
  export type TimeSeriesTableProps = PanelProps<TimeSeriesTableOptions, TimeSeriesData>;
6
6
  export declare function TimeSeriesTablePanel(props: TimeSeriesTableProps): ReactElement;
7
7
  //# sourceMappingURL=TimeSeriesTablePanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeSeriesTablePanel.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTablePanel.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGjD,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,sBAAsB,EAAE,cAAc,CAAC,CAAC;AAEtF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CAa9E"}
1
+ {"version":3,"file":"TimeSeriesTablePanel.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTablePanel.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,sBAAsB,EAAE,cAAc,CAAC,CAAC;AAEtF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CAa9E"}
@@ -11,9 +11,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { Box } from '@mui/material';
15
- import { useChartsTheme } from '@perses-dev/components';
16
- import { DataTable } from './components';
14
+ import { Box } from "@mui/material";
15
+ import { useChartsTheme } from "@perses-dev/components";
16
+ import { DataTable } from "./components/index.js";
17
17
  export function TimeSeriesTablePanel(props) {
18
18
  const { contentDimensions, queryResults, spec } = props;
19
19
  const chartsTheme = useChartsTheme();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/TimeSeriesTablePanel.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box } from '@mui/material';\nimport { useChartsTheme } from '@perses-dev/components';\nimport { ReactElement } from 'react';\nimport { PanelProps } from '@perses-dev/plugin-system';\n\nimport { TimeSeriesData } from '@perses-dev/spec';\nimport { TimeSeriesTableOptions } from './model';\nimport { DataTable } from './components';\n\nexport type TimeSeriesTableProps = PanelProps<TimeSeriesTableOptions, TimeSeriesData>;\n\nexport function TimeSeriesTablePanel(props: TimeSeriesTableProps): ReactElement {\n const { contentDimensions, queryResults, spec } = props;\n const chartsTheme = useChartsTheme();\n const contentPadding = chartsTheme.container.padding.default;\n\n return (\n <Box\n style={{ height: contentDimensions?.height ?? 0 }}\n sx={{ padding: `${contentPadding}px`, overflowY: 'scroll' }}\n >\n <DataTable queryResults={queryResults} spec={spec} />\n </Box>\n );\n}\n"],"names":["Box","useChartsTheme","DataTable","TimeSeriesTablePanel","props","contentDimensions","queryResults","spec","chartsTheme","contentPadding","container","padding","default","style","height","sx","overflowY"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,cAAc,QAAQ,yBAAyB;AAMxD,SAASC,SAAS,QAAQ,eAAe;AAIzC,OAAO,SAASC,qBAAqBC,KAA2B;IAC9D,MAAM,EAAEC,iBAAiB,EAAEC,YAAY,EAAEC,IAAI,EAAE,GAAGH;IAClD,MAAMI,cAAcP;IACpB,MAAMQ,iBAAiBD,YAAYE,SAAS,CAACC,OAAO,CAACC,OAAO;IAE5D,qBACE,KAACZ;QACCa,OAAO;YAAEC,QAAQT,mBAAmBS,UAAU;QAAE;QAChDC,IAAI;YAAEJ,SAAS,GAAGF,eAAe,EAAE,CAAC;YAAEO,WAAW;QAAS;kBAE1D,cAAA,KAACd;YAAUI,cAAcA;YAAcC,MAAMA;;;AAGnD"}
1
+ {"version":3,"sources":["../../src/TimeSeriesTablePanel.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box } from '@mui/material';\nimport { useChartsTheme } from '@perses-dev/components';\nimport type { PanelProps } from '@perses-dev/plugin-system';\nimport type { TimeSeriesData } from '@perses-dev/spec';\nimport type { ReactElement } from 'react';\n\nimport { DataTable } from './components';\nimport type { TimeSeriesTableOptions } from './model';\n\nexport type TimeSeriesTableProps = PanelProps<TimeSeriesTableOptions, TimeSeriesData>;\n\nexport function TimeSeriesTablePanel(props: TimeSeriesTableProps): ReactElement {\n const { contentDimensions, queryResults, spec } = props;\n const chartsTheme = useChartsTheme();\n const contentPadding = chartsTheme.container.padding.default;\n\n return (\n <Box\n style={{ height: contentDimensions?.height ?? 0 }}\n sx={{ padding: `${contentPadding}px`, overflowY: 'scroll' }}\n >\n <DataTable queryResults={queryResults} spec={spec} />\n </Box>\n );\n}\n"],"names":["Box","useChartsTheme","DataTable","TimeSeriesTablePanel","props","contentDimensions","queryResults","spec","chartsTheme","contentPadding","container","padding","default","style","height","sx","overflowY"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,cAAc,QAAQ,yBAAyB;AAKxD,SAASC,SAAS,QAAQ,wBAAe;AAKzC,OAAO,SAASC,qBAAqBC,KAA2B;IAC9D,MAAM,EAAEC,iBAAiB,EAAEC,YAAY,EAAEC,IAAI,EAAE,GAAGH;IAClD,MAAMI,cAAcP;IACpB,MAAMQ,iBAAiBD,YAAYE,SAAS,CAACC,OAAO,CAACC,OAAO;IAE5D,qBACE,KAACZ;QACCa,OAAO;YAAEC,QAAQT,mBAAmBS,UAAU;QAAE;QAChDC,IAAI;YAAEJ,SAAS,GAAGF,eAAe,EAAE,CAAC;YAAEO,WAAW;QAAS;kBAE1D,cAAA,KAACd;YAAUI,cAAcA;YAAcC,MAAMA;;;AAGnD"}
package/lib/bootstrap.js CHANGED
@@ -11,8 +11,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import React from 'react';
15
- import ReactDOM from 'react-dom/client';
14
+ import React from "react";
15
+ import ReactDOM from "react-dom/client";
16
16
  const root = ReactDOM.createRoot(document.getElementById('root'));
17
17
  root.render(/*#__PURE__*/ _jsx(React.StrictMode, {}));
18
18
 
@@ -1,7 +1,7 @@
1
- import { PanelData } from '@perses-dev/plugin-system';
2
- import { ReactElement, ReactNode } from 'react';
3
- import { HistogramValue, TimeSeriesData } from '@perses-dev/spec';
4
- import { TimeSeriesTableOptions } from '../model';
1
+ import type { PanelData } from '@perses-dev/plugin-system';
2
+ import type { HistogramValue, TimeSeriesData } from '@perses-dev/spec';
3
+ import type { ReactElement, ReactNode } from 'react';
4
+ import type { TimeSeriesTableOptions } from '../model';
5
5
  export interface DataTableProps {
6
6
  queryResults: Array<PanelData<TimeSeriesData>>;
7
7
  spec: TimeSeriesTableOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAiB,SAAS,EAAwB,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAC;AACtE,OAAO,EAAe,cAAc,EAAc,cAAc,EAA4B,MAAM,kBAAkB,CAAC;AACrH,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAMlD,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;IAC/C,IAAI,EAAE,sBAAsB,CAAC;CAC9B;AAeD;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,wBAAwB,cAAc,KAAG,YAAY,GAAG,IAoLjF,CAAC;AAKF,eAAO,MAAM,iBAAiB,GAAI,6CAA6C,CAC7E,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,CACP,KAAG,MAEH,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,GAAG,cAAc,KAAG,SAsBlD,CAAC"}
1
+ {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,KAAK,EAEV,cAAc,EAEd,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAMvD,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;IAC/C,IAAI,EAAE,sBAAsB,CAAC;CAC9B;AAeD;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,wBAAwB,cAAc,KAAG,YAAY,GAAG,IAoLjF,CAAC;AAKF,eAAO,MAAM,iBAAiB,GAAI,6CAA6C,CAC7E,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,CACP,KAAG,MAEH,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,GAAG,cAAc,KAAG,SAsBlD,CAAC"}
@@ -11,13 +11,13 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { Alert, Box, Checkbox, Stack, Table, TableBody, TableCell, TableHead, TableRow, Typography } from '@mui/material';
15
- import { useSelection } from '@perses-dev/components';
16
- import { useSelectionItemActions } from '@perses-dev/dashboards';
17
- import { useAllVariableValues } from '@perses-dev/plugin-system';
18
- import { useCallback, useMemo } from 'react';
19
- import { EmbeddedPanel } from './EmbeddedPanel';
20
- import { SeriesName } from './SeriesName';
14
+ import { Alert, Box, Checkbox, Stack, Table, TableBody, TableCell, TableHead, TableRow, Typography } from "@mui/material";
15
+ import { useSelection } from "@perses-dev/components";
16
+ import { useSelectionItemActions } from "@perses-dev/dashboards";
17
+ import { useAllVariableValues } from "@perses-dev/plugin-system";
18
+ import { useCallback, useMemo } from "react";
19
+ import { EmbeddedPanel } from "./EmbeddedPanel.js";
20
+ import { SeriesName } from "./SeriesName.js";
21
21
  const MAX_FORMATTABLE_SERIES = 1000;
22
22
  /**
23
23
  * Build row data object from a TimeSeries, including all labels and value
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DataTable.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n Alert,\n Box,\n Checkbox,\n Stack,\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableRow,\n Typography,\n} from '@mui/material';\nimport { useSelection } from '@perses-dev/components';\nimport { useSelectionItemActions } from '@perses-dev/dashboards';\nimport { ActionOptions, PanelData, useAllVariableValues } from '@perses-dev/plugin-system';\nimport { ReactElement, ReactNode, useCallback, useMemo } from 'react';\nimport { BucketTuple, HistogramValue, TimeSeries, TimeSeriesData, TimeSeriesHistogramTuple } from '@perses-dev/spec';\nimport { TimeSeriesTableOptions } from '../model';\nimport { EmbeddedPanel } from './EmbeddedPanel';\nimport { SeriesName } from './SeriesName';\n\nconst MAX_FORMATTABLE_SERIES = 1000;\n\nexport interface DataTableProps {\n queryResults: Array<PanelData<TimeSeriesData>>;\n spec: TimeSeriesTableOptions;\n}\n\n/**\n * Build row data object from a TimeSeries, including all labels and value\n */\nfunction buildRowData(ts: TimeSeries): Record<string, unknown> {\n return {\n ...ts.labels,\n name: ts.name,\n formattedName: ts.formattedName,\n value: ts.values?.[0]?.[1],\n timestamp: ts.values?.[0]?.[0],\n };\n}\n\n/**\n * Designed to display timeseries data in a prometheus like table format.\n * The first column will contain the metric name and label combination, and the second column will contain the values.\n * This is inspired by prometheus DataTable.\n * https://github.com/prometheus/prometheus/blob/2524a915915d7eb1b1207152d2e0ce5771193404/web/ui/react-app/src/pages/graph/DataTable.tsx\n * @param result timeseries query result\n * @constructor\n */\nexport const DataTable = ({ queryResults, spec }: DataTableProps): ReactElement | null => {\n const allVariables = useAllVariableValues();\n const series = useMemo(() => queryResults.flatMap((d) => d.data).flatMap((d) => d?.series || []), [queryResults]);\n\n const selectionEnabled = spec.selection?.enabled ?? false;\n const { selectionMap, setSelection, clearSelection, toggleSelection } = useSelection<\n Record<string, unknown>,\n string\n >();\n\n const itemActionsConfig = spec.actions ? (spec.actions as ActionOptions) : undefined;\n const itemActionsListConfig = useMemo(\n () => (itemActionsConfig?.enabled && itemActionsConfig.displayWithItem ? itemActionsConfig.actionsList : []),\n [itemActionsConfig?.enabled, itemActionsConfig?.displayWithItem, itemActionsConfig?.actionsList]\n );\n\n const { getItemActionButtons, confirmDialog, actionButtons } = useSelectionItemActions({\n actions: itemActionsListConfig,\n variableState: allVariables,\n });\n\n const hasItemActions = actionButtons && actionButtons.length > 0;\n\n const allSelected = useMemo(() => {\n if (series.length === 0) return false;\n return series.every((_, idx) => selectionMap.has(idx.toString()));\n }, [series, selectionMap]);\n\n // Check if some (but not all) series are selected\n const someSelected = useMemo(() => {\n if (series.length === 0) return false;\n const selectedCount = series.filter((_, idx) => selectionMap.has(idx.toString())).length;\n return selectedCount > 0 && selectedCount < series.length;\n }, [series, selectionMap]);\n\n const handleSelectAll = useCallback(() => {\n if (allSelected) {\n clearSelection();\n } else {\n const allItems = series.map((ts, idx) => ({\n id: idx.toString(),\n item: buildRowData(ts),\n }));\n setSelection(allItems);\n }\n }, [allSelected, series, setSelection, clearSelection]);\n\n const handleRowSelectionToggle = useCallback(\n (ts: TimeSeries, seriesIdx: number) => {\n const rowData = buildRowData(ts);\n toggleSelection(rowData, seriesIdx.toString());\n },\n [toggleSelection]\n );\n\n // Memoize row data for stable references\n const rowsData = useMemo(() => {\n return series.map((ts, idx) => ({\n ts,\n idx,\n rowData: buildRowData(ts),\n }));\n }, [series]);\n\n if (!queryResults || !series?.length) {\n return (\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n height: '100%',\n }}\n >\n <Typography>No data</Typography>\n </Box>\n );\n }\n\n return (\n <>\n {confirmDialog}\n {series.length >= MAX_FORMATTABLE_SERIES && (\n <Alert severity=\"warning\">\n Showing more than {MAX_FORMATTABLE_SERIES} series, turning off label formatting for performance reasons.\n </Alert>\n )}\n <Table className=\"data-table\">\n {selectionEnabled && series.length > 0 && (\n <TableHead>\n <TableRow>\n <TableCell padding=\"checkbox\">\n <Checkbox\n indeterminate={someSelected}\n checked={allSelected}\n onChange={handleSelectAll}\n inputProps={{ 'aria-label': 'select all series' }}\n />\n </TableCell>\n <TableCell>Series</TableCell>\n <TableCell>Value</TableCell>\n {hasItemActions && <TableCell>Actions</TableCell>}\n </TableRow>\n </TableHead>\n )}\n <TableBody>\n {rowsData.map(({ ts, idx, rowData }) => {\n const displayTimeStamps = (ts.values?.length ?? 0) > 1;\n const valuesAndTimes = ts.values\n ? ts.values.map((v, valIdx) => (\n <Typography key={valIdx}>\n {v[1]} {displayTimeStamps && <span>@{v[0]}</span>}\n </Typography>\n ))\n : [];\n\n let histogramsAndTimes = null;\n if (ts.histograms && ts.histograms.length > 0) {\n const seriesQueryResult: PanelData<TimeSeriesData> = {\n ...queryResults[0]!,\n data: {\n ...queryResults[0]!.data,\n series: [queryResults[0]!.data.series[idx]!],\n },\n };\n\n histogramsAndTimes = ts.histograms.map((h: TimeSeriesHistogramTuple, hisIdx: number) => (\n <Stack alignItems=\"center\" key={-hisIdx}>\n <Box width={400} height={200}>\n <EmbeddedPanel\n kind=\"HistogramChart\"\n spec={{ unit: 'decimal', width: 400, height: 200 }}\n queryResults={[seriesQueryResult]}\n />\n </Box>\n <Stack flexDirection=\"row\" justifyContent=\"space-between\" width=\"100%\">\n <Typography>Total count: {h[1].count}</Typography>\n <Typography>Sum: {h[1].sum}</Typography>\n </Stack>\n {histogramTable(h[1])}\n </Stack>\n ));\n }\n\n const rowId = idx.toString();\n const isSelected = selectionMap.has(rowId);\n const isFormatted = series.length < MAX_FORMATTABLE_SERIES;\n\n return (\n <TableRow style={{ whiteSpace: 'pre' }} key={idx}>\n {selectionEnabled && (\n <TableCell padding=\"checkbox\">\n <Checkbox\n checked={isSelected}\n onChange={() => handleRowSelectionToggle(ts, idx)}\n inputProps={{ 'aria-label': `select series ${idx}` }}\n />\n </TableCell>\n )}\n <TableCell>\n <SeriesName\n name={ts.name}\n formattedName={ts.formattedName}\n labels={ts.labels}\n isFormatted={isFormatted}\n />\n </TableCell>\n <TableCell>{ts.histograms ? histogramsAndTimes : valuesAndTimes}</TableCell>\n {hasItemActions && (\n <TableCell>\n <Box sx={{ display: 'flex', gap: 1 }}>{getItemActionButtons({ id: rowId, data: rowData })}</Box>\n </TableCell>\n )}\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n </>\n );\n};\n\nconst leftDelim = (br: number): string => (br === 3 || br === 1 ? '[' : '(');\nconst rightDelim = (br: number): string => (br === 3 || br === 0 ? ']' : ')');\n\nexport const bucketRangeString = ([boundaryRule, leftBoundary, rightBoundary]: [\n number,\n string,\n string,\n string,\n]): string => {\n return `${leftDelim(boundaryRule)}${leftBoundary} -> ${rightBoundary}${rightDelim(boundaryRule)}`;\n};\n\nexport const histogramTable = (h: HistogramValue): ReactNode => (\n <Table>\n <TableHead>\n <TableRow>\n <TableCell style={{ textAlign: 'center' }} colSpan={2}>\n Histogram Sample\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n <TableRow>\n <TableCell>Range</TableCell>\n <TableCell>Count</TableCell>\n </TableRow>\n {h.buckets?.map((b: BucketTuple, i: number) => (\n <TableRow key={i}>\n <TableCell>{bucketRangeString(b)}</TableCell>\n <TableCell>{b[3]}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n);\n"],"names":["Alert","Box","Checkbox","Stack","Table","TableBody","TableCell","TableHead","TableRow","Typography","useSelection","useSelectionItemActions","useAllVariableValues","useCallback","useMemo","EmbeddedPanel","SeriesName","MAX_FORMATTABLE_SERIES","buildRowData","ts","labels","name","formattedName","value","values","timestamp","DataTable","queryResults","spec","allVariables","series","flatMap","d","data","selectionEnabled","selection","enabled","selectionMap","setSelection","clearSelection","toggleSelection","itemActionsConfig","actions","undefined","itemActionsListConfig","displayWithItem","actionsList","getItemActionButtons","confirmDialog","actionButtons","variableState","hasItemActions","length","allSelected","every","_","idx","has","toString","someSelected","selectedCount","filter","handleSelectAll","allItems","map","id","item","handleRowSelectionToggle","seriesIdx","rowData","rowsData","sx","display","justifyContent","alignItems","height","severity","className","padding","indeterminate","checked","onChange","inputProps","displayTimeStamps","valuesAndTimes","v","valIdx","span","histogramsAndTimes","histograms","seriesQueryResult","h","hisIdx","width","kind","unit","flexDirection","count","sum","histogramTable","rowId","isSelected","isFormatted","style","whiteSpace","gap","leftDelim","br","rightDelim","bucketRangeString","boundaryRule","leftBoundary","rightBoundary","textAlign","colSpan","buckets","b","i"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SACEA,KAAK,EACLC,GAAG,EACHC,QAAQ,EACRC,KAAK,EACLC,KAAK,EACLC,SAA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;;oCAChDjC,gCACC,KAAC7C;kDACC,cAAA,KAACL;4CAAIsE,IAAI;gDAAEC,SAAS;gDAAQiC,KAAK;4CAAE;sDAAI1D,qBAAqB;gDAAEkB,IAAImC;gDAAOnE,MAAMoC;4CAAQ;;;;+BArBhDb;wBA0BjD;;;;;;AAKV,EAAE;AAEF,MAAMkD,YAAY,CAACC,KAAwBA,OAAO,KAAKA,OAAO,IAAI,MAAM;AACxE,MAAMC,aAAa,CAACD,KAAwBA,OAAO,KAAKA,OAAO,IAAI,MAAM;AAEzE,OAAO,MAAME,oBAAoB,CAAC,CAACC,cAAcC,cAAcC,cAK9D;IACC,OAAO,GAAGN,UAAUI,gBAAgBC,aAAa,IAAI,EAAEC,gBAAgBJ,WAAWE,eAAe;AACnG,EAAE;AAEF,OAAO,MAAMX,iBAAiB,CAACR,kBAC7B,MAACvF;;0BACC,KAACG;0BACC,cAAA,KAACC;8BACC,cAAA,KAACF;wBAAUiG,OAAO;4BAAEU,WAAW;wBAAS;wBAAGC,SAAS;kCAAG;;;;0BAK3D,MAAC7G;;kCACC,MAACG;;0CACC,KAACF;0CAAU;;0CACX,KAACA;0CAAU;;;;oBAEZqF,EAAEwB,OAAO,EAAEnD,IAAI,CAACoD,GAAgBC,kBAC/B,MAAC7G;;8CACC,KAACF;8CAAWuG,kBAAkBO;;8CAC9B,KAAC9G;8CAAW8G,CAAC,CAAC,EAAE;;;2BAFHC;;;;OAOrB"}
1
+ {"version":3,"sources":["../../../src/components/DataTable.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n Alert,\n Box,\n Checkbox,\n Stack,\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableRow,\n Typography,\n} from '@mui/material';\nimport { useSelection } from '@perses-dev/components';\nimport { useSelectionItemActions } from '@perses-dev/dashboards';\nimport type { ActionOptions, PanelData } from '@perses-dev/plugin-system';\nimport { useAllVariableValues } from '@perses-dev/plugin-system';\nimport type {\n BucketTuple,\n HistogramValue,\n TimeSeries,\n TimeSeriesData,\n TimeSeriesHistogramTuple,\n} from '@perses-dev/spec';\nimport type { ReactElement, ReactNode } from 'react';\nimport { useCallback, useMemo } from 'react';\n\nimport type { TimeSeriesTableOptions } from '../model';\nimport { EmbeddedPanel } from './EmbeddedPanel';\nimport { SeriesName } from './SeriesName';\n\nconst MAX_FORMATTABLE_SERIES = 1000;\n\nexport interface DataTableProps {\n queryResults: Array<PanelData<TimeSeriesData>>;\n spec: TimeSeriesTableOptions;\n}\n\n/**\n * Build row data object from a TimeSeries, including all labels and value\n */\nfunction buildRowData(ts: TimeSeries): Record<string, unknown> {\n return {\n ...ts.labels,\n name: ts.name,\n formattedName: ts.formattedName,\n value: ts.values?.[0]?.[1],\n timestamp: ts.values?.[0]?.[0],\n };\n}\n\n/**\n * Designed to display timeseries data in a prometheus like table format.\n * The first column will contain the metric name and label combination, and the second column will contain the values.\n * This is inspired by prometheus DataTable.\n * https://github.com/prometheus/prometheus/blob/2524a915915d7eb1b1207152d2e0ce5771193404/web/ui/react-app/src/pages/graph/DataTable.tsx\n * @param result timeseries query result\n * @constructor\n */\nexport const DataTable = ({ queryResults, spec }: DataTableProps): ReactElement | null => {\n const allVariables = useAllVariableValues();\n const series = useMemo(() => queryResults.flatMap((d) => d.data).flatMap((d) => d?.series || []), [queryResults]);\n\n const selectionEnabled = spec.selection?.enabled ?? false;\n const { selectionMap, setSelection, clearSelection, toggleSelection } = useSelection<\n Record<string, unknown>,\n string\n >();\n\n const itemActionsConfig = spec.actions ? (spec.actions as ActionOptions) : undefined;\n const itemActionsListConfig = useMemo(\n () => (itemActionsConfig?.enabled && itemActionsConfig.displayWithItem ? itemActionsConfig.actionsList : []),\n [itemActionsConfig?.enabled, itemActionsConfig?.displayWithItem, itemActionsConfig?.actionsList],\n );\n\n const { getItemActionButtons, confirmDialog, actionButtons } = useSelectionItemActions({\n actions: itemActionsListConfig,\n variableState: allVariables,\n });\n\n const hasItemActions = actionButtons && actionButtons.length > 0;\n\n const allSelected = useMemo(() => {\n if (series.length === 0) return false;\n return series.every((_, idx) => selectionMap.has(idx.toString()));\n }, [series, selectionMap]);\n\n // Check if some (but not all) series are selected\n const someSelected = useMemo(() => {\n if (series.length === 0) return false;\n const selectedCount = series.filter((_, idx) => selectionMap.has(idx.toString())).length;\n return selectedCount > 0 && selectedCount < series.length;\n }, [series, selectionMap]);\n\n const handleSelectAll = useCallback(() => {\n if (allSelected) {\n clearSelection();\n } else {\n const allItems = series.map((ts, idx) => ({\n id: idx.toString(),\n item: buildRowData(ts),\n }));\n setSelection(allItems);\n }\n }, [allSelected, series, setSelection, clearSelection]);\n\n const handleRowSelectionToggle = useCallback(\n (ts: TimeSeries, seriesIdx: number) => {\n const rowData = buildRowData(ts);\n toggleSelection(rowData, seriesIdx.toString());\n },\n [toggleSelection],\n );\n\n // Memoize row data for stable references\n const rowsData = useMemo(() => {\n return series.map((ts, idx) => ({\n ts,\n idx,\n rowData: buildRowData(ts),\n }));\n }, [series]);\n\n if (!queryResults || !series?.length) {\n return (\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n height: '100%',\n }}\n >\n <Typography>No data</Typography>\n </Box>\n );\n }\n\n return (\n <>\n {confirmDialog}\n {series.length >= MAX_FORMATTABLE_SERIES && (\n <Alert severity=\"warning\">\n Showing more than {MAX_FORMATTABLE_SERIES} series, turning off label formatting for performance reasons.\n </Alert>\n )}\n <Table className=\"data-table\">\n {selectionEnabled && series.length > 0 && (\n <TableHead>\n <TableRow>\n <TableCell padding=\"checkbox\">\n <Checkbox\n indeterminate={someSelected}\n checked={allSelected}\n onChange={handleSelectAll}\n inputProps={{ 'aria-label': 'select all series' }}\n />\n </TableCell>\n <TableCell>Series</TableCell>\n <TableCell>Value</TableCell>\n {hasItemActions && <TableCell>Actions</TableCell>}\n </TableRow>\n </TableHead>\n )}\n <TableBody>\n {rowsData.map(({ ts, idx, rowData }) => {\n const displayTimeStamps = (ts.values?.length ?? 0) > 1;\n const valuesAndTimes = ts.values\n ? ts.values.map((v, valIdx) => (\n <Typography key={valIdx}>\n {v[1]} {displayTimeStamps && <span>@{v[0]}</span>}\n </Typography>\n ))\n : [];\n\n let histogramsAndTimes = null;\n if (ts.histograms && ts.histograms.length > 0) {\n const seriesQueryResult: PanelData<TimeSeriesData> = {\n ...queryResults[0]!,\n data: {\n ...queryResults[0]!.data,\n series: [queryResults[0]!.data.series[idx]!],\n },\n };\n\n histogramsAndTimes = ts.histograms.map((h: TimeSeriesHistogramTuple, hisIdx: number) => (\n <Stack alignItems=\"center\" key={-hisIdx}>\n <Box width={400} height={200}>\n <EmbeddedPanel\n kind=\"HistogramChart\"\n spec={{ unit: 'decimal', width: 400, height: 200 }}\n queryResults={[seriesQueryResult]}\n />\n </Box>\n <Stack flexDirection=\"row\" justifyContent=\"space-between\" width=\"100%\">\n <Typography>Total count: {h[1].count}</Typography>\n <Typography>Sum: {h[1].sum}</Typography>\n </Stack>\n {histogramTable(h[1])}\n </Stack>\n ));\n }\n\n const rowId = idx.toString();\n const isSelected = selectionMap.has(rowId);\n const isFormatted = series.length < MAX_FORMATTABLE_SERIES;\n\n return (\n <TableRow style={{ whiteSpace: 'pre' }} key={idx}>\n {selectionEnabled && (\n <TableCell padding=\"checkbox\">\n <Checkbox\n checked={isSelected}\n onChange={() => handleRowSelectionToggle(ts, idx)}\n inputProps={{ 'aria-label': `select series ${idx}` }}\n />\n </TableCell>\n )}\n <TableCell>\n <SeriesName\n name={ts.name}\n formattedName={ts.formattedName}\n labels={ts.labels}\n isFormatted={isFormatted}\n />\n </TableCell>\n <TableCell>{ts.histograms ? histogramsAndTimes : valuesAndTimes}</TableCell>\n {hasItemActions && (\n <TableCell>\n <Box sx={{ display: 'flex', gap: 1 }}>{getItemActionButtons({ id: rowId, data: rowData })}</Box>\n </TableCell>\n )}\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n </>\n );\n};\n\nconst leftDelim = (br: number): string => (br === 3 || br === 1 ? '[' : '(');\nconst rightDelim = (br: number): string => (br === 3 || br === 0 ? ']' : ')');\n\nexport const bucketRangeString = ([boundaryRule, leftBoundary, rightBoundary]: [\n number,\n string,\n string,\n string,\n]): string => {\n return `${leftDelim(boundaryRule)}${leftBoundary} -> ${rightBoundary}${rightDelim(boundaryRule)}`;\n};\n\nexport const histogramTable = (h: HistogramValue): ReactNode => (\n <Table>\n <TableHead>\n <TableRow>\n <TableCell style={{ textAlign: 'center' }} colSpan={2}>\n Histogram Sample\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n <TableRow>\n <TableCell>Range</TableCell>\n <TableCell>Count</TableCell>\n </TableRow>\n {h.buckets?.map((b: BucketTuple, i: number) => (\n <TableRow key={i}>\n <TableCell>{bucketRangeString(b)}</TableCell>\n <TableCell>{b[3]}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n);\n"],"names":["Alert","Box","Checkbox","Stack","Table","TableBody","TableCell","TableHead","TableRow","Typography","useSelection","useSelectionItemActions","useAllVariableValues","useCallback","useMemo","EmbeddedPanel","SeriesName","MAX_FORMATTABLE_SERIES","buildRowData","ts","labels","name","formattedName","value","values","timestamp","DataTable","queryResults","spec","allVariables","series","flatMap","d","data","selectionEnabled","selection","enabled","selectionMap","setSelection","clearSelection","toggleSelection","itemActionsConfig","actions","undefined","itemActionsListConfig","displayWithItem","actionsList","getItemActionButtons","confirmDialog","actionButtons","variableState","hasItemActions","length","allSelected","every","_","idx","has","toString","someSelected","selectedCount","filter","handleSelectAll","allItems","map","id","item","handleRowSelectionToggle","seriesIdx","rowData","rowsData","sx","display","justifyContent","alignItems","height","severity","className","padding","indeterminate","checked","onChange","inputProps","displayTimeStamps","valuesAndTimes","v","valIdx","span","histogramsAndTimes","histograms","seriesQueryResult","h","hisIdx","width","kind","unit","flexDirection","count","sum","histogramTable","rowId","isSelected","isFormatted","style","whiteSpace","gap","leftDelim","br","rightDelim","bucketRangeString","boundaryRule","leftBoundary","rightBoundary","textAlign","colSpan","buckets","b","i"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SACEA,KAAK,EACLC,GAAG,EACHC,QAAQ,EACRC,KAAK,EACLC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,UAAU,QACL,gBAAgB;AACvB,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,uBAAuB,QAAQ,yBAAyB;AAEjE,SAASC,oBAAoB,QAAQ,4BAA4B;AASjE,SAASC,WAAW,EAAEC,OAAO,QAAQ,QAAQ;AAG7C,SAASC,aAAa,QAAQ,qBAAkB;AAChD,SAASC,UAAU,QAAQ,kBAAe;AAE1C,MAAMC,yBAAyB;AAO/B;;CAEC,GACD,SAASC,aAAaC,EAAc;IAClC,OAAO;QACL,GAAGA,GAAGC,MAAM;QACZC,MAAMF,GAAGE,IAAI;QACbC,eAAeH,GAAGG,aAAa;QAC/BC,OAAOJ,GAAGK,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE;QAC1BC,WAAWN,GAAGK,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE;IAChC;AACF;AAEA;;;;;;;CAOC,GACD,OAAO,MAAME,YAAY,CAAC,EAAEC,YAAY,EAAEC,IAAI,EAAkB;IAC9D,MAAMC,eAAejB;IACrB,MAAMkB,SAAShB,QAAQ,IAAMa,aAAaI,OAAO,CAAC,CAACC,I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nD,IAAI,CAACoD,GAAgBC,kBAC/B,MAAC7G;;8CACC,KAACF;8CAAWuG,kBAAkBO;;8CAC9B,KAAC9G;8CAAW8G,CAAC,CAAC,EAAE;;;2BAFHC;;;;OAOrB"}
@@ -1,6 +1,6 @@
1
- import { PanelData } from '@perses-dev/plugin-system';
2
- import { ReactElement } from 'react';
3
- import { QueryDataType, UnknownSpec } from '@perses-dev/spec';
1
+ import type { PanelData } from '@perses-dev/plugin-system';
2
+ import type { QueryDataType, UnknownSpec } from '@perses-dev/spec';
3
+ import type { ReactElement } from 'react';
4
4
  interface EmbeddedPanelProps {
5
5
  kind: string;
6
6
  spec: UnknownSpec;
@@ -1 +1 @@
1
- {"version":3,"file":"EmbeddedPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmbeddedPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAItD,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE9D,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,CAAC;IAClB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;CAC/C;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,kBAAkB,GAAG,YAAY,CAS5F"}
1
+ {"version":3,"file":"EmbeddedPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmbeddedPanel.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,CAAC;IAClB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;CAC/C;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,kBAAkB,GAAG,YAAY,CAS5F"}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  // Copyright The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
@@ -10,10 +11,9 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { PanelPluginLoader } from '@perses-dev/dashboards';
15
- import useResizeObserver from 'use-resize-observer';
16
- import { ErrorAlert, ErrorBoundary } from '@perses-dev/components';
14
+ import { ErrorAlert, ErrorBoundary } from "@perses-dev/components";
15
+ import { PanelPluginLoader } from "@perses-dev/dashboards";
16
+ import useResizeObserver from "use-resize-observer";
17
17
  export function EmbeddedPanel({ kind, spec, queryResults }) {
18
18
  const { ref, width = 1, height = 1 } = useResizeObserver();
19
19
  return /*#__PURE__*/ _jsx("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/EmbeddedPanel.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PanelData } from '@perses-dev/plugin-system';\nimport { PanelPluginLoader } from '@perses-dev/dashboards';\nimport useResizeObserver from 'use-resize-observer';\nimport { ErrorAlert, ErrorBoundary } from '@perses-dev/components';\nimport { ReactElement } from 'react';\nimport { QueryDataType, UnknownSpec } from '@perses-dev/spec';\n\ninterface EmbeddedPanelProps {\n kind: string;\n spec: UnknownSpec;\n queryResults: Array<PanelData<QueryDataType>>;\n}\n\nexport function EmbeddedPanel({ kind, spec, queryResults }: EmbeddedPanelProps): ReactElement {\n const { ref, width = 1, height = 1 } = useResizeObserver<HTMLDivElement>();\n return (\n <div ref={ref} style={{ height: '100%' }}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <PanelPluginLoader kind={kind} contentDimensions={{ width, height }} spec={spec} queryResults={queryResults} />\n </ErrorBoundary>\n </div>\n );\n}\n"],"names":["PanelPluginLoader","useResizeObserver","ErrorAlert","ErrorBoundary","EmbeddedPanel","kind","spec","queryResults","ref","width","height","div","style","FallbackComponent","contentDimensions"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,iBAAiB,QAAQ,yBAAyB;AAC3D,OAAOC,uBAAuB,sBAAsB;AACpD,SAASC,UAAU,EAAEC,aAAa,QAAQ,yBAAyB;AAUnE,OAAO,SAASC,cAAc,EAAEC,IAAI,EAAEC,IAAI,EAAEC,YAAY,EAAsB;IAC5E,MAAM,EAAEC,GAAG,EAAEC,QAAQ,CAAC,EAAEC,SAAS,CAAC,EAAE,GAAGT;IACvC,qBACE,KAACU;QAAIH,KAAKA;QAAKI,OAAO;YAAEF,QAAQ;QAAO;kBACrC,cAAA,KAACP;YAAcU,mBAAmBX;sBAChC,cAAA,KAACF;gBAAkBK,MAAMA;gBAAMS,mBAAmB;oBAAEL;oBAAOC;gBAAO;gBAAGJ,MAAMA;gBAAMC,cAAcA;;;;AAIvG"}
1
+ {"version":3,"sources":["../../../src/components/EmbeddedPanel.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ErrorAlert, ErrorBoundary } from '@perses-dev/components';\nimport { PanelPluginLoader } from '@perses-dev/dashboards';\nimport type { PanelData } from '@perses-dev/plugin-system';\nimport type { QueryDataType, UnknownSpec } from '@perses-dev/spec';\nimport type { ReactElement } from 'react';\nimport useResizeObserver from 'use-resize-observer';\n\ninterface EmbeddedPanelProps {\n kind: string;\n spec: UnknownSpec;\n queryResults: Array<PanelData<QueryDataType>>;\n}\n\nexport function EmbeddedPanel({ kind, spec, queryResults }: EmbeddedPanelProps): ReactElement {\n const { ref, width = 1, height = 1 } = useResizeObserver<HTMLDivElement>();\n return (\n <div ref={ref} style={{ height: '100%' }}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <PanelPluginLoader kind={kind} contentDimensions={{ width, height }} spec={spec} queryResults={queryResults} />\n </ErrorBoundary>\n </div>\n );\n}\n"],"names":["ErrorAlert","ErrorBoundary","PanelPluginLoader","useResizeObserver","EmbeddedPanel","kind","spec","queryResults","ref","width","height","div","style","FallbackComponent","contentDimensions"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,UAAU,EAAEC,aAAa,QAAQ,yBAAyB;AACnE,SAASC,iBAAiB,QAAQ,yBAAyB;AAI3D,OAAOC,uBAAuB,sBAAsB;AAQpD,OAAO,SAASC,cAAc,EAAEC,IAAI,EAAEC,IAAI,EAAEC,YAAY,EAAsB;IAC5E,MAAM,EAAEC,GAAG,EAAEC,QAAQ,CAAC,EAAEC,SAAS,CAAC,EAAE,GAAGP;IACvC,qBACE,KAACQ;QAAIH,KAAKA;QAAKI,OAAO;YAAEF,QAAQ;QAAO;kBACrC,cAAA,KAACT;YAAcY,mBAAmBb;sBAChC,cAAA,KAACE;gBAAkBG,MAAMA;gBAAMS,mBAAmB;oBAAEL;oBAAOC;gBAAO;gBAAGJ,MAAMA;gBAAMC,cAAcA;;;;AAIvG"}
@@ -1,5 +1,5 @@
1
- import { ReactElement } from 'react';
2
- import { Labels } from '@perses-dev/spec';
1
+ import type { Labels } from '@perses-dev/spec';
2
+ import type { ReactElement } from 'react';
3
3
  interface SeriesNameProps {
4
4
  name: string;
5
5
  labels?: Labels;
@@ -1 +1 @@
1
- {"version":3,"file":"SeriesName.d.ts","sourceRoot":"","sources":["../../../src/components/SeriesName.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAc,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAMD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,eAAe,GAAG,YAAY,CAKtG"}
1
+ {"version":3,"file":"SeriesName.d.ts","sourceRoot":"","sources":["../../../src/components/SeriesName.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,OAAO,CAAC;AAEtD,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAMD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,eAAe,GAAG,YAAY,CAKtG"}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  // Copyright The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
@@ -10,9 +11,8 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- import { useSnackbar } from '@perses-dev/components';
15
- import { Typography } from '@mui/material';
14
+ import { Typography } from "@mui/material";
15
+ import { useSnackbar } from "@perses-dev/components";
16
16
  /*
17
17
  * Display a series with labels in bold and with a copy to clipboard feature if isFormatted is enabled
18
18
  * Else it will only display the series in plain text (mostly use for performance reasons)
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SeriesName.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, MouseEvent } from 'react';\nimport { useSnackbar } from '@perses-dev/components';\nimport { Typography } from '@mui/material';\nimport { Labels } from '@perses-dev/spec';\n\ninterface SeriesNameProps {\n name: string;\n labels?: Labels;\n formattedName?: string;\n isFormatted?: boolean;\n}\n\n/*\n * Display a series with labels in bold and with a copy to clipboard feature if isFormatted is enabled\n * Else it will only display the series in plain text (mostly use for performance reasons)\n */\nexport function SeriesName({ name, labels, formattedName, isFormatted }: SeriesNameProps): ReactElement {\n if (isFormatted && labels && Object.keys(labels).length > 0) {\n return <FormatedSeriesName labels={labels} />;\n }\n return <Typography sx={{ textWrap: 'auto' }}>{formattedName ?? name}</Typography>;\n}\n\nfunction FormatedSeriesName({ labels }: { labels: Labels }): ReactElement {\n const { infoSnackbar } = useSnackbar();\n\n const labelNodes: ReactElement[] = [];\n let first = true;\n\n function copyToClipboard(e: MouseEvent<HTMLSpanElement>): void {\n const copyText = e.currentTarget.innerText || '';\n navigator.clipboard\n .writeText(copyText.trim())\n .then(() => {\n infoSnackbar(`Copied label matcher: ${copyText}`);\n })\n .catch((reason) => {\n console.error(`unable to copy text: ${reason}`);\n });\n }\n\n for (const label in labels) {\n if (label === '__name__') {\n continue;\n }\n\n labelNodes.push(\n <span key={label}>\n {!first && ', '}\n <Typography\n display=\"inline\"\n component=\"span\"\n sx={{\n '&:hover': {\n cursor: 'pointer',\n textDecoration: 'underline',\n },\n }}\n onClick={copyToClipboard}\n title=\"Click to copy label matcher\"\n >\n <strong>{label}</strong>=<span>&quot;{labels[label]}&quot;</span>\n </Typography>\n </span>\n );\n\n if (first) {\n first = false;\n }\n }\n\n return (\n <Typography sx={{ textWrap: 'auto' }}>\n {labels ? labels.__name__ : ''}\n {'{'}\n {labelNodes}\n {'}'}\n </Typography>\n );\n}\n"],"names":["useSnackbar","Typography","SeriesName","name","labels","formattedName","isFormatted","Object","keys","length","FormatedSeriesName","sx","textWrap","infoSnackbar","labelNodes","first","copyToClipboard","e","copyText","currentTarget","innerText","navigator","clipboard","writeText","trim","then","catch","reason","console","error","label","push","span","display","component","cursor","textDecoration","onClick","title","strong","__name__"],"mappings":"AAAA,+BAA+B;AAC/B,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AC,MAACE;;gCAAK;gCAAO5B,MAAM,CAAC0B,MAAM;gCAAC;;;;;;WAd7CA;QAmBb,IAAIf,OAAO;YACTA,QAAQ;QACV;IACF;IAEA,qBACE,MAACd;QAAWU,IAAI;YAAEC,UAAU;QAAO;;YAChCR,SAASA,OAAOoC,QAAQ,GAAG;YAC3B;YACA1B;YACA;;;AAGP"}
1
+ {"version":3,"sources":["../../../src/components/SeriesName.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Typography } from '@mui/material';\nimport { useSnackbar } from '@perses-dev/components';\nimport type { Labels } from '@perses-dev/spec';\nimport type { ReactElement, MouseEvent } from 'react';\n\ninterface SeriesNameProps {\n name: string;\n labels?: Labels;\n formattedName?: string;\n isFormatted?: boolean;\n}\n\n/*\n * Display a series with labels in bold and with a copy to clipboard feature if isFormatted is enabled\n * Else it will only display the series in plain text (mostly use for performance reasons)\n */\nexport function SeriesName({ name, labels, formattedName, isFormatted }: SeriesNameProps): ReactElement {\n if (isFormatted && labels && Object.keys(labels).length > 0) {\n return <FormatedSeriesName labels={labels} />;\n }\n return <Typography sx={{ textWrap: 'auto' }}>{formattedName ?? name}</Typography>;\n}\n\nfunction FormatedSeriesName({ labels }: { labels: Labels }): ReactElement {\n const { infoSnackbar } = useSnackbar();\n\n const labelNodes: ReactElement[] = [];\n let first = true;\n\n function copyToClipboard(e: MouseEvent<HTMLSpanElement>): void {\n const copyText = e.currentTarget.innerText || '';\n navigator.clipboard\n .writeText(copyText.trim())\n .then(() => {\n infoSnackbar(`Copied label matcher: ${copyText}`);\n })\n .catch((reason) => {\n console.error(`unable to copy text: ${reason}`);\n });\n }\n\n for (const label in labels) {\n if (label === '__name__') {\n continue;\n }\n\n labelNodes.push(\n <span key={label}>\n {!first && ', '}\n <Typography\n display=\"inline\"\n component=\"span\"\n sx={{\n '&:hover': {\n cursor: 'pointer',\n textDecoration: 'underline',\n },\n }}\n onClick={copyToClipboard}\n title=\"Click to copy label matcher\"\n >\n <strong>{label}</strong>=<span>&quot;{labels[label]}&quot;</span>\n </Typography>\n </span>,\n );\n\n if (first) {\n first = false;\n }\n }\n\n return (\n <Typography sx={{ textWrap: 'auto' }}>\n {labels ? labels.__name__ : ''}\n {'{'}\n {labelNodes}\n {'}'}\n </Typography>\n );\n}\n"],"names":["Typography","useSnackbar","SeriesName","name","labels","formattedName","isFormatted","Object","keys","length","FormatedSeriesName","sx","textWrap","infoSnackbar","labelNodes","first","copyToClipboard","e","copyText","currentTarget","innerText","navigator","clipboard","writeText","trim","then","catch","reason","console","error","label","push","span","display","component","cursor","textDecoration","onClick","title","strong","__name__"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,WAAW,QAAQ,yBAAyB;AAWrD;;;CAGC,GACD,OAAO,SAASC,WAAW,EAAEC,IAAI,EAAEC,MAAM,EAAEC,aAAa,EAAEC,WAAW,EAAmB;IACtF,IAAIA,eAAeF,UAAUG,OAAOC,IAAI,CAACJ,QAAQK,MAAM,GAAG,GAAG;QAC3D,qBAAO,KAACC;YAAmBN,QAAQA;;IACrC;IACA,qBAAO,KAACJ;QAAWW,IAAI;YAAEC,UAAU;QAAO;kBAAIP,iBAAiBF;;AACjE;AAEA,SAASO,mBAAmB,EAAEN,MAAM,EAAsB;IACxD,MAAM,EAAES,YAAY,EAAE,GAAGZ;IAEzB,MAAMa,aAA6B,EAAE;IACrC,IAAIC,QAAQ;IAEZ,SAASC,gBAAgBC,CAA8B;QACrD,MAAMC,WAAWD,EAAEE,aAAa,CAACC,SAAS,IAAI;QAC9CC,UAAUC,SAAS,CAChBC,SAAS,CAACL,SAASM,IAAI,IACvBC,IAAI,CAAC;YACJZ,aAAa,CAAC,sBAAsB,EAAEK,UAAU;QAClD,GACCQ,KAAK,CAAC,CAACC;YACNC,QAAQC,KAAK,CAAC,CAAC,qBAAqB,EAAEF,QAAQ;QAChD;IACJ;IAEA,IAAK,MAAMG,SAAS1B,OAAQ;QAC1B,IAAI0B,UAAU,YAAY;YACxB;QACF;QAEAhB,WAAWiB,IAAI,eACb,MAACC;;gBACE,CAACjB,SAAS;8BACX,MAACf;oBACCiC,SAAQ;oBACRC,WAAU;oBACVvB,IAAI;wBACF,WAAW;4BACTwB,QAAQ;4BACRC,gBAAgB;wBAClB;oBACF;oBACAC,SAASrB;oBACTsB,OAAM;;sCAEN,KAACC;sCAAQT;;wBAAe;sCAAC,MAACE;;gCAAK;gCAAO5B,MAAM,CAAC0B,MAAM;gCAAC;;;;;;WAd7CA;QAmBb,IAAIf,OAAO;YACTA,QAAQ;QACV;IACF;IAEA,qBACE,MAACf;QAAWW,IAAI;YAAEC,UAAU;QAAO;;YAChCR,SAASA,OAAOoC,QAAQ,GAAG;YAC3B;YACA1B;YACA;;;AAGP"}
@@ -1,4 +1,4 @@
1
- import { ReactElement } from 'react';
2
- import { TimeSeriesTableSettingsEditorProps } from '../model';
1
+ import type { ReactElement } from 'react';
2
+ import type { TimeSeriesTableSettingsEditorProps } from '../model';
3
3
  export declare function TimeSeriesTableItemSelectionActionsEditor({ value, onChange, }: TimeSeriesTableSettingsEditorProps): ReactElement;
4
4
  //# sourceMappingURL=TimeSeriesTableItemSelectionActionsEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeSeriesTableItemSelectionActionsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/TimeSeriesTableItemSelectionActionsEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAE9D,wBAAgB,yCAAyC,CAAC,EACxD,KAAK,EACL,QAAQ,GACT,EAAE,kCAAkC,GAAG,YAAY,CAiBnD"}
1
+ {"version":3,"file":"TimeSeriesTableItemSelectionActionsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/TimeSeriesTableItemSelectionActionsEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAEnE,wBAAgB,yCAAyC,CAAC,EACxD,KAAK,EACL,QAAQ,GACT,EAAE,kCAAkC,GAAG,YAAY,CAiBnD"}
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  // Copyright 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,7 +10,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
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
- import { ItemSelectionActionsEditor } from '@perses-dev/plugin-system';
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { ItemSelectionActionsEditor } from "@perses-dev/plugin-system";
15
15
  export function TimeSeriesTableItemSelectionActionsEditor({ value, onChange }) {
16
16
  function handleActionsChange(actions) {
17
17
  onChange({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/TimeSeriesTableItemSelectionActionsEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ActionOptions, ItemSelectionActionsEditor, SelectionOptions } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { TimeSeriesTableSettingsEditorProps } from '../model';\n\nexport function TimeSeriesTableItemSelectionActionsEditor({\n value,\n onChange,\n}: TimeSeriesTableSettingsEditorProps): ReactElement {\n function handleActionsChange(actions: ActionOptions | undefined): void {\n onChange({ ...value, actions: actions });\n }\n\n function handleSelectionChange(selection: SelectionOptions | undefined): void {\n onChange({ ...value, selection: selection });\n }\n\n return (\n <ItemSelectionActionsEditor\n actionOptions={value.actions}\n onChangeActions={handleActionsChange}\n selectionOptions={value.selection}\n onChangeSelection={handleSelectionChange}\n />\n );\n}\n"],"names":["ItemSelectionActionsEditor","TimeSeriesTableItemSelectionActionsEditor","value","onChange","handleActionsChange","actions","handleSelectionChange","selection","actionOptions","onChangeActions","selectionOptions","onChangeSelection"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAwBA,0BAA0B,QAA0B,4BAA4B;AAIxG,OAAO,SAASC,0CAA0C,EACxDC,KAAK,EACLC,QAAQ,EAC2B;IACnC,SAASC,oBAAoBC,OAAkC;QAC7DF,SAAS;YAAE,GAAGD,KAAK;YAAEG,SAASA;QAAQ;IACxC;IAEA,SAASC,sBAAsBC,SAAuC;QACpEJ,SAAS;YAAE,GAAGD,KAAK;YAAEK,WAAWA;QAAU;IAC5C;IAEA,qBACE,KAACP;QACCQ,eAAeN,MAAMG,OAAO;QAC5BI,iBAAiBL;QACjBM,kBAAkBR,MAAMK,SAAS;QACjCI,mBAAmBL;;AAGzB"}
1
+ {"version":3,"sources":["../../../src/components/TimeSeriesTableItemSelectionActionsEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { ActionOptions, SelectionOptions } from '@perses-dev/plugin-system';\nimport { ItemSelectionActionsEditor } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\n\nimport type { TimeSeriesTableSettingsEditorProps } from '../model';\n\nexport function TimeSeriesTableItemSelectionActionsEditor({\n value,\n onChange,\n}: TimeSeriesTableSettingsEditorProps): ReactElement {\n function handleActionsChange(actions: ActionOptions | undefined): void {\n onChange({ ...value, actions: actions });\n }\n\n function handleSelectionChange(selection: SelectionOptions | undefined): void {\n onChange({ ...value, selection: selection });\n }\n\n return (\n <ItemSelectionActionsEditor\n actionOptions={value.actions}\n onChangeActions={handleActionsChange}\n selectionOptions={value.selection}\n onChangeSelection={handleSelectionChange}\n />\n );\n}\n"],"names":["ItemSelectionActionsEditor","TimeSeriesTableItemSelectionActionsEditor","value","onChange","handleActionsChange","actions","handleSelectionChange","selection","actionOptions","onChangeActions","selectionOptions","onChangeSelection"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,0BAA0B,QAAQ,4BAA4B;AAKvE,OAAO,SAASC,0CAA0C,EACxDC,KAAK,EACLC,QAAQ,EAC2B;IACnC,SAASC,oBAAoBC,OAAkC;QAC7DF,SAAS;YAAE,GAAGD,KAAK;YAAEG,SAASA;QAAQ;IACxC;IAEA,SAASC,sBAAsBC,SAAuC;QACpEJ,SAAS;YAAE,GAAGD,KAAK;YAAEK,WAAWA;QAAU;IAC5C;IAEA,qBACE,KAACP;QACCQ,eAAeN,MAAMG,OAAO;QAC5BI,iBAAiBL;QACjBM,kBAAkBR,MAAMK,SAAS;QACjCI,mBAAmBL;;AAGzB"}
@@ -10,8 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './DataTable';
14
- export * from './SeriesName';
15
- export * from './TimeSeriesTableItemSelectionActionsEditor';
13
+ export * from "./DataTable.js";
14
+ export * from "./SeriesName.js";
15
+ export * from "./TimeSeriesTableItemSelectionActionsEditor.js";
16
16
 
17
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './DataTable';\nexport * from './SeriesName';\nexport * from './TimeSeriesTableItemSelectionActionsEditor';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,cAAc;AAC5B,cAAc,eAAe;AAC7B,cAAc,8CAA8C"}
1
+ {"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './DataTable';\nexport * from './SeriesName';\nexport * from './TimeSeriesTableItemSelectionActionsEditor';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,iBAAc;AAC5B,cAAc,kBAAe;AAC7B,cAAc,iDAA8C"}
@@ -1,4 +1,4 @@
1
- import { PluginModuleResource } from '@perses-dev/plugin-system';
1
+ import type { PluginModuleResource } from '@perses-dev/plugin-system';
2
2
  /**
3
3
  * Returns the plugin module information from package.json
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"getPluginModule.d.ts","sourceRoot":"","sources":["../../src/getPluginModule.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AAGnF;;GAEG;AACH,wBAAgB,eAAe,IAAI,oBAAoB,CAUtD"}
1
+ {"version":3,"file":"getPluginModule.d.ts","sourceRoot":"","sources":["../../src/getPluginModule.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AAIxF;;GAEG;AACH,wBAAgB,eAAe,IAAI,oBAAoB,CAUtD"}
@@ -10,7 +10,9 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import packageJson from '../package.json';
13
+ import packageJson from "../package.json" with {
14
+ type: 'json'
15
+ };
14
16
  /**
15
17
  * Returns the plugin module information from package.json
16
18
  */ export function getPluginModule() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\nimport packageJson from '../package.json';\n\n/**\n * Returns the plugin module information from package.json\n */\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","getPluginModule","name","version","perses","kind","metadata","spec"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,OAAOA,iBAAiB,kBAAkB;AAE1C;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGJ;IAClC,OAAO;QACLK,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
1
+ {"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\n\nimport packageJson from '../package.json' with { type: 'json' };\n\n/**\n * Returns the plugin module information from package.json\n */\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","type","getPluginModule","name","version","perses","kind","metadata","spec"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAOA,iBAAiB,uBAAuB;IAAEC,MAAM;AAAO,EAAE;AAEhE;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGL;IAClC,OAAO;QACLM,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
@@ -10,6 +10,6 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import('./bootstrap');
13
+ import("./bootstrap.js");
14
14
 
15
15
  //# sourceMappingURL=index-federation.js.map
package/lib/index.js CHANGED
@@ -10,11 +10,11 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './components/DataTable';
14
- export { getPluginModule } from './getPluginModule';
15
- export * from './model';
16
- export * from './components/SeriesName';
17
- export * from './TimeSeriesTable';
18
- export * from './TimeSeriesTablePanel';
13
+ export * from "./components/DataTable.js";
14
+ export { getPluginModule } from "./getPluginModule.js";
15
+ export * from "./model.js";
16
+ export * from "./components/SeriesName.js";
17
+ export * from "./TimeSeriesTable.js";
18
+ export * from "./TimeSeriesTablePanel.js";
19
19
 
20
20
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './components/DataTable';\nexport { getPluginModule } from './getPluginModule';\nexport * from './model';\nexport * from './components/SeriesName';\nexport * from './TimeSeriesTable';\nexport * from './TimeSeriesTablePanel';\n"],"names":["getPluginModule"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,yBAAyB;AACvC,SAASA,eAAe,QAAQ,oBAAoB;AACpD,cAAc,UAAU;AACxB,cAAc,0BAA0B;AACxC,cAAc,oBAAoB;AAClC,cAAc,yBAAyB"}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './components/DataTable';\nexport { getPluginModule } from './getPluginModule';\nexport * from './model';\nexport * from './components/SeriesName';\nexport * from './TimeSeriesTable';\nexport * from './TimeSeriesTablePanel';\n"],"names":["getPluginModule"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,4BAAyB;AACvC,SAASA,eAAe,QAAQ,uBAAoB;AACpD,cAAc,aAAU;AACxB,cAAc,6BAA0B;AACxC,cAAc,uBAAoB;AAClC,cAAc,4BAAyB"}
package/lib/model.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ActionOptions, OptionsEditorProps, SelectionOptions } from '@perses-dev/plugin-system';
1
+ import type { ActionOptions, OptionsEditorProps, SelectionOptions } from '@perses-dev/plugin-system';
2
2
  export interface TimeSeriesTableOptions {
3
3
  /**
4
4
  * Enable row selection with checkboxes
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAEhG,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,MAAM,kCAAkC,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/model.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAErG,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,MAAM,kCAAkC,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,CAAC"}
package/lib/model.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ActionOptions, OptionsEditorProps, SelectionOptions } from '@perses-dev/plugin-system';\n\nexport interface TimeSeriesTableOptions {\n /**\n * Enable row selection with checkboxes\n */\n selection?: SelectionOptions;\n /**\n * Configure actions that can be executed on selected rows\n */\n actions?: ActionOptions;\n}\n\nexport type TimeSeriesTableSettingsEditorProps = OptionsEditorProps<TimeSeriesTableOptions>;\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAejC,WAA4F"}
1
+ {"version":3,"sources":["../../src/model.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { ActionOptions, OptionsEditorProps, SelectionOptions } from '@perses-dev/plugin-system';\n\nexport interface TimeSeriesTableOptions {\n /**\n * Enable row selection with checkboxes\n */\n selection?: SelectionOptions;\n /**\n * Configure actions that can be executed on selected rows\n */\n actions?: ActionOptions;\n}\n\nexport type TimeSeriesTableSettingsEditorProps = OptionsEditorProps<TimeSeriesTableOptions>;\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAejC,WAA4F"}
@@ -1,2 +1,2 @@
1
- import '@testing-library/jest-dom';
1
+ import '@testing-library/jest-dom/vitest';
2
2
  //# sourceMappingURL=setup-tests.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup-tests.d.ts","sourceRoot":"","sources":["../../src/setup-tests.ts"],"names":[],"mappings":"AAaA,OAAO,2BAA2B,CAAC"}
1
+ {"version":3,"file":"setup-tests.d.ts","sourceRoot":"","sources":["../../src/setup-tests.ts"],"names":[],"mappings":"AAaA,OAAO,kCAAkC,CAAC"}
@@ -10,8 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import '@testing-library/jest-dom';
13
+ import "@testing-library/jest-dom/vitest";
14
14
  // Always mock e-charts during tests since we don't have a proper canvas in jsdom
15
- jest.mock('echarts/core');
15
+ vi.mock('echarts/core');
16
16
 
17
17
  //# sourceMappingURL=setup-tests.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport '@testing-library/jest-dom';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n"],"names":["jest","mock"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,4BAA4B;AAEnC,iFAAiF;AACjFA,KAAKC,IAAI,CAAC"}
1
+ {"version":3,"sources":["../../src/setup-tests.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport '@testing-library/jest-dom/vitest';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\nvi.mock('echarts/core');\n"],"names":["vi","mock"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,mCAAmC;AAE1C,iFAAiF;AACjFA,GAAGC,IAAI,CAAC"}
@@ -1,4 +1,4 @@
1
- import { TimeSeriesData } from '@perses-dev/spec';
1
+ import type { TimeSeriesData } from '@perses-dev/spec';
2
2
  export declare const MOCK_TIME_SERIES_QUERY_RESULT_MULTIVALUE: {
3
3
  status: string;
4
4
  fetchStatus: string;
@@ -1 +1 @@
1
- {"version":3,"file":"mock-query-results.d.ts","sourceRoot":"","sources":["../../../src/test/mock-query-results.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DpD,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDrD,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,cAsC9C,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,cAgC/C,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgElC,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;CAU7C,CAAC"}
1
+ {"version":3,"file":"mock-query-results.d.ts","sourceRoot":"","sources":["../../../src/test/mock-query-results.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DpD,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDrD,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,cAsC9C,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,cAgC/C,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgElC,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;CAU7C,CAAC"}