@perses-dev/table-plugin 0.11.0-rc.0 → 0.11.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 (124) hide show
  1. package/__mf/js/{Table.7c94517d.js → Table.2fc0ce5e.js} +3 -3
  2. package/__mf/js/async/1117.b21b0ae4.js +2 -0
  3. package/__mf/js/async/{2473.2c502914.js → 1432.acd0ad59.js} +1 -1
  4. package/__mf/js/async/272.3bc7825c.js +1 -0
  5. package/__mf/js/async/392.49e51fc5.js +2 -0
  6. package/__mf/js/async/4510.a0a1dd48.js +7 -0
  7. package/__mf/js/async/54.467c4f98.js +22 -0
  8. package/__mf/js/async/6811.4e18bc66.js +38 -0
  9. package/__mf/js/async/9010.fd805430.js +1 -0
  10. package/__mf/js/async/{1432.4dcbe7e3.js → 9051.e3054e02.js} +1 -1
  11. package/__mf/js/async/__federation_expose_Table.b3466cfe.js +1 -0
  12. package/__mf/js/async/lib-router.2e1dec85.js +2 -0
  13. package/__mf/js/async/{lib-router.8fd59130.js.LICENSE.txt → lib-router.2e1dec85.js.LICENSE.txt} +3 -3
  14. package/__mf/js/{main.1250232e.js → main.83aeba98.js} +3 -3
  15. package/lib/Table.d.ts +1 -1
  16. package/lib/Table.d.ts.map +1 -1
  17. package/lib/Table.js +7 -2
  18. package/lib/Table.js.map +1 -1
  19. package/lib/bootstrap.js +1 -1
  20. package/lib/bootstrap.js.map +1 -1
  21. package/lib/cjs/Table.js +7 -2
  22. package/lib/cjs/bootstrap.js +1 -1
  23. package/lib/cjs/components/CellsEditor/CellsEditor.js +1 -1
  24. package/lib/cjs/components/CellsEditor/index.js +1 -1
  25. package/lib/cjs/components/ColumnsEditor/ColumnEditor.js +1 -1
  26. package/lib/cjs/components/ColumnsEditor/ColumnEditorContainer.js +1 -1
  27. package/lib/cjs/components/ColumnsEditor/ColumnsEditor.js +1 -1
  28. package/lib/cjs/components/ColumnsEditor/DataLinkEditorDialog.js +1 -1
  29. package/lib/cjs/components/ColumnsEditor/index.js +1 -1
  30. package/lib/cjs/components/ConditionalPanel.js +12 -0
  31. package/lib/cjs/components/EmbeddedPanel.js +1 -1
  32. package/lib/cjs/components/TableCellsEditor.js +1 -1
  33. package/lib/cjs/components/TableColumnsEditor.js +1 -1
  34. package/lib/cjs/components/TableItemSelectionActionsEditor.js +44 -0
  35. package/lib/cjs/components/TablePanel.js +73 -10
  36. package/lib/cjs/components/TableSettingsEditor.js +1 -1
  37. package/lib/cjs/components/TableTransformsEditor.js +1 -1
  38. package/lib/cjs/components/index.js +2 -1
  39. package/lib/cjs/env.d.js +1 -1
  40. package/lib/cjs/getPluginModule.js +12 -0
  41. package/lib/cjs/index-federation.js +1 -1
  42. package/lib/cjs/index.js +12 -0
  43. package/lib/cjs/models/index.js +1 -1
  44. package/lib/cjs/models/model.js +1 -1
  45. package/lib/cjs/models/table-model.js +1 -1
  46. package/lib/cjs/setup-tests.js +1 -1
  47. package/lib/cjs/test/mock-query-results.js +1 -1
  48. package/lib/components/CellsEditor/CellsEditor.js +1 -1
  49. package/lib/components/CellsEditor/CellsEditor.js.map +1 -1
  50. package/lib/components/CellsEditor/index.js +1 -1
  51. package/lib/components/CellsEditor/index.js.map +1 -1
  52. package/lib/components/ColumnsEditor/ColumnEditor.js +1 -1
  53. package/lib/components/ColumnsEditor/ColumnEditor.js.map +1 -1
  54. package/lib/components/ColumnsEditor/ColumnEditorContainer.js +1 -1
  55. package/lib/components/ColumnsEditor/ColumnEditorContainer.js.map +1 -1
  56. package/lib/components/ColumnsEditor/ColumnsEditor.js +1 -1
  57. package/lib/components/ColumnsEditor/ColumnsEditor.js.map +1 -1
  58. package/lib/components/ColumnsEditor/DataLinkEditorDialog.js +1 -1
  59. package/lib/components/ColumnsEditor/DataLinkEditorDialog.js.map +1 -1
  60. package/lib/components/ColumnsEditor/index.js +1 -1
  61. package/lib/components/ColumnsEditor/index.js.map +1 -1
  62. package/lib/components/ConditionalPanel.d.ts.map +1 -1
  63. package/lib/components/ConditionalPanel.js +12 -0
  64. package/lib/components/ConditionalPanel.js.map +1 -1
  65. package/lib/components/EmbeddedPanel.js +1 -1
  66. package/lib/components/EmbeddedPanel.js.map +1 -1
  67. package/lib/components/TableCellsEditor.js +1 -1
  68. package/lib/components/TableCellsEditor.js.map +1 -1
  69. package/lib/components/TableColumnsEditor.js +1 -1
  70. package/lib/components/TableColumnsEditor.js.map +1 -1
  71. package/lib/components/TableItemSelectionActionsEditor.d.ts +4 -0
  72. package/lib/components/TableItemSelectionActionsEditor.d.ts.map +1 -0
  73. package/lib/components/TableItemSelectionActionsEditor.js +36 -0
  74. package/lib/components/TableItemSelectionActionsEditor.js.map +1 -0
  75. package/lib/components/TablePanel.d.ts +1 -1
  76. package/lib/components/TablePanel.d.ts.map +1 -1
  77. package/lib/components/TablePanel.js +75 -12
  78. package/lib/components/TablePanel.js.map +1 -1
  79. package/lib/components/TableSettingsEditor.js +1 -1
  80. package/lib/components/TableSettingsEditor.js.map +1 -1
  81. package/lib/components/TableTransformsEditor.js +1 -1
  82. package/lib/components/TableTransformsEditor.js.map +1 -1
  83. package/lib/components/index.d.ts +1 -0
  84. package/lib/components/index.d.ts.map +1 -1
  85. package/lib/components/index.js +2 -1
  86. package/lib/components/index.js.map +1 -1
  87. package/lib/env.d.js +1 -1
  88. package/lib/env.d.js.map +1 -1
  89. package/lib/getPluginModule.d.ts.map +1 -1
  90. package/lib/getPluginModule.js +12 -0
  91. package/lib/getPluginModule.js.map +1 -1
  92. package/lib/index-federation.js +1 -1
  93. package/lib/index-federation.js.map +1 -1
  94. package/lib/index.d.ts.map +1 -1
  95. package/lib/index.js +12 -0
  96. package/lib/index.js.map +1 -1
  97. package/lib/models/index.js +1 -1
  98. package/lib/models/index.js.map +1 -1
  99. package/lib/models/model.js +1 -1
  100. package/lib/models/model.js.map +1 -1
  101. package/lib/models/table-model.d.ts +3 -1
  102. package/lib/models/table-model.d.ts.map +1 -1
  103. package/lib/models/table-model.js +1 -1
  104. package/lib/models/table-model.js.map +1 -1
  105. package/lib/setup-tests.js +1 -1
  106. package/lib/setup-tests.js.map +1 -1
  107. package/lib/test/mock-query-results.js +1 -1
  108. package/lib/test/mock-query-results.js.map +1 -1
  109. package/mf-manifest.json +23 -23
  110. package/mf-stats.json +25 -25
  111. package/package.json +6 -5
  112. package/__mf/js/async/1117.87be49e9.js +0 -2
  113. package/__mf/js/async/1490.9d97e5d1.js +0 -22
  114. package/__mf/js/async/3827.1b39b042.js +0 -38
  115. package/__mf/js/async/3919.927efb3c.js +0 -7
  116. package/__mf/js/async/392.c2307fe5.js +0 -2
  117. package/__mf/js/async/5501.bc363348.js +0 -1
  118. package/__mf/js/async/8094.c02682f3.js +0 -1
  119. package/__mf/js/async/__federation_expose_Table.61be353a.js +0 -1
  120. package/__mf/js/async/lib-router.8fd59130.js +0 -2
  121. /package/__mf/js/async/{1117.87be49e9.js.LICENSE.txt → 1117.b21b0ae4.js.LICENSE.txt} +0 -0
  122. /package/__mf/js/async/{392.c2307fe5.js.LICENSE.txt → 392.49e51fc5.js.LICENSE.txt} +0 -0
  123. /package/__mf/js/async/{3919.927efb3c.js.LICENSE.txt → 4510.a0a1dd48.js.LICENSE.txt} +0 -0
  124. /package/__mf/js/async/{1490.9d97e5d1.js.LICENSE.txt → 54.467c4f98.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ColumnsEditor/DataLinkEditorDialog.tsx"],"sourcesContent":["// Copyright 2025 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 { LinkEditorForm } from '@perses-dev/components';\nimport { ReactElement } from 'react';\nimport { IconButton, Stack, Typography } from '@mui/material';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport MinusIcon from 'mdi-material-ui/Minus';\nimport { ColumnEditorProps } from './ColumnEditor';\n\nexport type Props = Pick<ColumnEditorProps, 'onChange' | 'column'>;\n\nexport const DataLinkEditor = (props: Props): ReactElement => {\n const {\n onChange,\n column,\n column: { dataLink },\n } = props;\n\n if (!dataLink) {\n return (\n <Stack sx={{ width: '100%', alignItems: 'center' }} direction=\"row\">\n <Typography flex={1} variant=\"subtitle1\" mb={2} fontStyle=\"italic\">\n No link defined\n </Typography>\n <IconButton\n style={{ width: 'fit-content', height: 'fit-content' }}\n onClick={() => onChange({ ...column, dataLink: { url: '', openNewTab: true, title: '' } })}\n >\n <PlusIcon />\n </IconButton>\n </Stack>\n );\n }\n\n const { url, openNewTab, title } = dataLink;\n\n return (\n <Stack sx={{ width: '100%', alignItems: 'center' }} direction=\"row\">\n <LinkEditorForm\n mode=\"inline\"\n url={{\n label: 'Url',\n onChange: (url) => {\n onChange({ ...column, dataLink: { ...dataLink, url } });\n },\n value: url,\n placeholder: 'URL',\n error: { hasError: false, helperText: '' },\n }}\n name={{\n label: 'Name',\n onChange: (title) => {\n onChange({ ...column, dataLink: { ...dataLink, title } });\n },\n value: title ?? '',\n placeholder: 'Name',\n }}\n newTabOpen={{\n label: 'Open in new tab',\n onChange: (openNewTab) => {\n onChange({ ...column, dataLink: { ...dataLink, openNewTab } });\n },\n value: openNewTab,\n }}\n />\n <IconButton\n style={{ width: 'fit-content', height: 'fit-content' }}\n onClick={() => {\n onChange({ ...column, dataLink: undefined });\n }}\n >\n <MinusIcon />\n </IconButton>\n </Stack>\n );\n};\n"],"names":["LinkEditorForm","IconButton","Stack","Typography","PlusIcon","MinusIcon","DataLinkEditor","props","onChange","column","dataLink","sx","width","alignItems","direction","flex","variant","mb","fontStyle","style","height","onClick","url","openNewTab","title","mode","label","value","placeholder","error","hasError","helperText","name","newTabOpen","undefined"],"mappings":";AAAA,oCAA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AG;gBAC3C;gBACAC,MAAM;oBACJN,OAAO;oBACPlB,UAAU,CAACgB;wBACThB,SAAS;4BAAE,GAAGC,MAAM;4BAAEC,UAAU;gCAAE,GAAGA,QAAQ;gCAAEc;4BAAM;wBAAE;oBACzD;oBACAG,OAAOH,SAAS;oBAChBI,aAAa;gBACf;gBACAK,YAAY;oBACVP,OAAO;oBACPlB,UAAU,CAACe;wBACTf,SAAS;4BAAE,GAAGC,MAAM;4BAAEC,UAAU;gCAAE,GAAGA,QAAQ;gCAAEa;4BAAW;wBAAE;oBAC9D;oBACAI,OAAOJ;gBACT;;0BAEF,KAACtB;gBACCkB,OAAO;oBAAEP,OAAO;oBAAeQ,QAAQ;gBAAc;gBACrDC,SAAS;oBACPb,SAAS;wBAAE,GAAGC,MAAM;wBAAEC,UAAUwB;oBAAU;gBAC5C;0BAEA,cAAA,KAAC7B;;;;AAIT,EAAE"}
1
+ {"version":3,"sources":["../../../../src/components/ColumnsEditor/DataLinkEditorDialog.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 { LinkEditorForm } from '@perses-dev/components';\nimport { ReactElement } from 'react';\nimport { IconButton, Stack, Typography } from '@mui/material';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport MinusIcon from 'mdi-material-ui/Minus';\nimport { ColumnEditorProps } from './ColumnEditor';\n\nexport type Props = Pick<ColumnEditorProps, 'onChange' | 'column'>;\n\nexport const DataLinkEditor = (props: Props): ReactElement => {\n const {\n onChange,\n column,\n column: { dataLink },\n } = props;\n\n if (!dataLink) {\n return (\n <Stack sx={{ width: '100%', alignItems: 'center' }} direction=\"row\">\n <Typography flex={1} variant=\"subtitle1\" mb={2} fontStyle=\"italic\">\n No link defined\n </Typography>\n <IconButton\n style={{ width: 'fit-content', height: 'fit-content' }}\n onClick={() => onChange({ ...column, dataLink: { url: '', openNewTab: true, title: '' } })}\n >\n <PlusIcon />\n </IconButton>\n </Stack>\n );\n }\n\n const { url, openNewTab, title } = dataLink;\n\n return (\n <Stack sx={{ width: '100%', alignItems: 'center' }} direction=\"row\">\n <LinkEditorForm\n mode=\"inline\"\n url={{\n label: 'Url',\n onChange: (url) => {\n onChange({ ...column, dataLink: { ...dataLink, url } });\n },\n value: url,\n placeholder: 'URL',\n error: { hasError: false, helperText: '' },\n }}\n name={{\n label: 'Name',\n onChange: (title) => {\n onChange({ ...column, dataLink: { ...dataLink, title } });\n },\n value: title ?? '',\n placeholder: 'Name',\n }}\n newTabOpen={{\n label: 'Open in new tab',\n onChange: (openNewTab) => {\n onChange({ ...column, dataLink: { ...dataLink, openNewTab } });\n },\n value: openNewTab,\n }}\n />\n <IconButton\n style={{ width: 'fit-content', height: 'fit-content' }}\n onClick={() => {\n onChange({ ...column, dataLink: undefined });\n }}\n >\n <MinusIcon />\n </IconButton>\n </Stack>\n );\n};\n"],"names":["LinkEditorForm","IconButton","Stack","Typography","PlusIcon","MinusIcon","DataLinkEditor","props","onChange","column","dataLink","sx","width","alignItems","direction","flex","variant","mb","fontStyle","style","height","onClick","url","openNewTab","title","mode","label","value","placeholder","error","hasError","helperText","name","newTabOpen","undefined"],"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,cAAc,QAAQ,yBAAyB;AAExD,SAASC,UAAU,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AAC9D,OAAOC,cAAc,uBAA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M;4BAAEC,UAAU;gCAAE,GAAGA,QAAQ;gCAAEa;4BAAW;wBAAE;oBAC9D;oBACAI,OAAOJ;gBACT;;0BAEF,KAACtB;gBACCkB,OAAO;oBAAEP,OAAO;oBAAeQ,QAAQ;gBAAc;gBACrDC,SAAS;oBACPb,SAAS;wBAAE,GAAGC,MAAM;wBAAEC,UAAUwB;oBAAU;gBAC5C;0BAEA,cAAA,KAAC7B;;;;AAIT,EAAE"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ColumnsEditor/index.ts"],"sourcesContent":["// Copyright 2024 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 './ColumnEditor';\nexport * from './ColumnEditorContainer';\nexport * from './ColumnsEditor';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,iBAAiB;AAC/B,cAAc,0BAA0B;AACxC,cAAc,kBAAkB"}
1
+ {"version":3,"sources":["../../../../src/components/ColumnsEditor/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 './ColumnEditor';\nexport * from './ColumnEditorContainer';\nexport * from './ColumnsEditor';\n"],"names":[],"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,cAAc,iBAAiB;AAC/B,cAAc,0BAA0B;AACxC,cAAc,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConditionalPanel.d.ts","sourceRoot":"","sources":["../../../src/components/ConditionalPanel.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,UAAU,IAAI,SAAS,EAQxB,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,YAAY,EAAyB,MAAM,WAAW,CAAC;AAGhE,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACvE,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,2CAyH3F;AAGD,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,SAAS,KAAK,IAAI,CAAC;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,YAAiB,EACjB,QAAQ,EACR,aAAwC,GACzC,EAAE,qBAAqB,2CAmDvB"}
1
+ {"version":3,"file":"ConditionalPanel.d.ts","sourceRoot":"","sources":["../../../src/components/ConditionalPanel.tsx"],"names":[],"mappings":"AAcA,OAAO,EAGL,UAAU,IAAI,SAAS,EAQxB,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,YAAY,EAAyB,MAAM,WAAW,CAAC;AAGhE,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACvE,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,2CAyH3F;AAGD,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,SAAS,KAAK,IAAI,CAAC;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,YAAiB,EACjB,QAAQ,EACR,aAAwC,GACzC,EAAE,qBAAqB,2CAmDvB"}
@@ -1,4 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
3
+ // Licensed under the Apache License, Version 2.0 (the \"License\");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an \"AS IS\" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
2
14
  import React from 'react';
3
15
  import { Button, Divider, IconButton, MenuItem, Stack, TextField, Tooltip, Typography, Grid2 as Grid } from '@mui/material';
4
16
  import DeleteIcon from 'mdi-material-ui/DeleteOutline';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ConditionalPanel.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Button,\n Divider,\n Grid2Props as GridProps,\n IconButton,\n MenuItem,\n Stack,\n TextField,\n Tooltip,\n Typography,\n Grid2 as Grid,\n} from '@mui/material';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport { OptionsColorPicker } from '@perses-dev/components';\nimport { CellSettings, renderConditionEditor } from '../models';\n\n// Individual conditional formatting rule component\nexport interface ConditionalRuleProps extends Omit<GridProps, 'onChange'> {\n cell: CellSettings;\n onChange: (cell: CellSettings) => void;\n onDelete: () => void;\n}\n\nexport function ConditionalRule({ cell, onChange, onDelete, ...props }: ConditionalRuleProps) {\n return (\n <Grid container spacing={2} {...props}>\n <Grid size={{ xs: 5 }}>\n <Stack direction=\"row\" gap={1} width=\"100%\">\n <TextField\n select\n label=\"Type\"\n value={cell.condition.kind}\n onChange={(e) => onChange({ ...cell, condition: { kind: e.target.value } } as CellSettings)}\n required\n sx={{ width: '120px' }}\n >\n <MenuItem value=\"Value\">\n <Stack>\n <Typography>Value</Typography>\n {cell.condition.kind !== 'Value' && (\n <Typography variant=\"caption\">Matches an exact text value</Typography>\n )}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Range\">\n <Stack>\n <Typography>Range</Typography>\n {cell.condition.kind !== 'Range' && (\n <Typography variant=\"caption\">Matches against a numerical range</Typography>\n )}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Regex\">\n <Stack>\n <Typography>Regex</Typography>\n {cell.condition.kind !== 'Regex' && (\n <Typography variant=\"caption\">Matches against a regular expression</Typography>\n )}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Misc\">\n <Stack>\n <Typography>Misc</Typography>\n {cell.condition.kind !== 'Misc' && (\n <Typography variant=\"caption\">Matches against empty, null and NaN values</Typography>\n )}\n </Stack>\n </MenuItem>\n </TextField>\n {renderConditionEditor(\n cell.condition,\n (updatedCondition) => onChange({ ...cell, condition: updatedCondition }),\n 'small'\n )}\n </Stack>\n </Grid>\n <Grid size={{ xs: 4 }}>\n <Stack spacing={1}>\n <TextField\n label=\"Display text\"\n value={cell.text}\n onChange={(e) => onChange({ ...cell, text: e.target.value })}\n fullWidth\n size=\"small\"\n />\n <Stack direction=\"row\" spacing={1}>\n <TextField\n label=\"Prefix\"\n placeholder=\"$\"\n value={cell.prefix ?? ''}\n onChange={(e) => onChange({ ...cell, prefix: e.target.value })}\n size=\"small\"\n />\n <TextField\n label=\"Suffix\"\n placeholder=\"%\"\n value={cell.suffix ?? ''}\n onChange={(e) => onChange({ ...cell, suffix: e.target.value })}\n size=\"small\"\n />\n </Stack>\n </Stack>\n </Grid>\n <Grid size={{ xs: 1 }}>\n <Stack direction=\"row\" justifyContent=\"center\" gap={1}>\n {cell.textColor ? (\n <OptionsColorPicker\n label=\"Text Color\"\n color={cell.textColor ?? '#000'}\n onColorChange={(color) => onChange({ ...cell, textColor: color } as CellSettings)}\n onClear={() => onChange({ ...cell, textColor: undefined } as CellSettings)}\n />\n ) : (\n <IconButton onClick={() => onChange({ ...cell, textColor: '#000' })}>\n <AddIcon />\n </IconButton>\n )}\n </Stack>\n </Grid>\n <Grid size={{ xs: 1 }}>\n <Stack direction=\"row\" justifyContent=\"center\">\n {cell.backgroundColor ? (\n <OptionsColorPicker\n label=\"Background Color\"\n color={cell.backgroundColor ?? '#fff'}\n onColorChange={(color) => onChange({ ...cell, backgroundColor: color } as CellSettings)}\n onClear={() => onChange({ ...cell, backgroundColor: undefined } as CellSettings)}\n />\n ) : (\n <IconButton onClick={() => onChange({ ...cell, backgroundColor: '#000' })}>\n <AddIcon />\n </IconButton>\n )}\n </Stack>\n </Grid>\n <Grid size={{ xs: 1 }} textAlign=\"end\">\n <Tooltip title=\"Remove cell settings\" placement=\"top\">\n <IconButton size=\"small\" sx={{ marginLeft: 'auto' }} onClick={onDelete} key=\"delete-cell-button\">\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n </Grid>\n </Grid>\n );\n}\n\n// Complete conditional formatting panel with headers and list management\nexport interface ConditionalPanelProps {\n cellSettings?: CellSettings[];\n onChange: (cellSettings: CellSettings[] | undefined) => void;\n addButtonText?: string;\n}\n\nexport function ConditionalPanel({\n cellSettings = [],\n onChange,\n addButtonText = 'Add Conditional Format',\n}: ConditionalPanelProps) {\n const handleCellChange = (index: number, updatedCell: CellSettings) => {\n const updatedCells = [...cellSettings];\n updatedCells[index] = updatedCell;\n onChange(updatedCells);\n };\n\n const handleCellDelete = (index: number) => {\n const updatedCells = [...cellSettings];\n updatedCells.splice(index, 1);\n onChange(updatedCells.length > 0 ? updatedCells : undefined);\n };\n\n const handleAddCell = () => {\n const updatedCells = [...cellSettings];\n updatedCells.push({ condition: { kind: 'Value', spec: { value: '' } } });\n onChange(updatedCells);\n };\n\n return (\n <Stack spacing={3} sx={{ mt: 2 }}>\n <Grid container spacing={3}>\n <Grid size={{ xs: 5 }}>\n <Typography variant=\"subtitle1\">Condition</Typography>\n </Grid>\n <Grid size={{ xs: 4 }}>\n <Typography variant=\"subtitle1\">Display Text</Typography>\n </Grid>\n <Grid size={{ xs: 1 }} textAlign=\"center\">\n <Typography variant=\"subtitle1\">Color</Typography>\n </Grid>\n <Grid size={{ xs: 1 }} textAlign=\"center\">\n <Typography variant=\"subtitle1\">Background</Typography>\n </Grid>\n <Grid size={{ xs: 1 }}></Grid>\n </Grid>\n <Stack gap={1.5} divider={<Divider flexItem orientation=\"horizontal\" />}>\n {cellSettings.map((cell, i) => (\n <ConditionalRule\n key={i}\n cell={cell}\n onChange={(updatedCell: CellSettings) => handleCellChange(i, updatedCell)}\n onDelete={() => handleCellDelete(i)}\n />\n ))}\n </Stack>\n <Button variant=\"outlined\" startIcon={<AddIcon />} sx={{ marginTop: 1 }} onClick={handleAddCell}>\n {addButtonText}\n </Button>\n </Stack>\n );\n}\n"],"names":["React","Button","Divider","IconButton","MenuItem","Stack","TextField","Tooltip","Typography","Grid2","Grid","DeleteIcon","AddIcon","OptionsColorPicker","renderConditionEditor","ConditionalRule","cell","onChange","onDelete","props","container","spacing","size","xs","direction","gap","width","select","label","value","condition","kind","e","target","required","sx","variant","updatedCondition","text","fullWidth","placeholder","prefix","suffix","justifyContent","textColor","color","onColorChange","onClear","undefined","onClick","backgroundColor","textAlign","title","placement","marginLeft","ConditionalPanel","cellSettings","addButtonText","handleCellChange","index","updatedCell","updatedCells","handleCellDelete","splice","length","handleAddCell","push","spec","mt","divider","flexItem","orientation","map","i","startIcon","marginTop"],"mappings":";AAAA,OAAOA,WAAW,QAAQ;AAC1B,SACEC,MAAM,EACNC,OAAO,EAEPC,UAAU,EACVC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,OAAO,EACPC,UAAU,EACVC,SAASC,IAAI,QACR,gBAAgB;AACvB,OAAOC,gBAAgB,gCAAgC;AACvD,OAAOC,aAAa,uBAAuB;AAC3C,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAAuBC,qBAAqB,QAAQ,YAAY;AAShE,OAAO,SAASC,gBAAgB,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,GAAGC,OAA6B;IAC1F,qBACE,MAACT;QAAKU,SAAS;QAACC,SAAS;QAAI,GAAGF,KAAK;;0BACnC,KAACT;gBAAKY,MAAM;oBAAEC,IAAI;gBAAE;0BAClB,cAAA,MAAClB;oBAAMmB,WAAU;oBAAMC,KAAK;oBAAGC,OAAM;;sCACnC,MAACpB;4BACCqB,MAAM;4BACNC,OAAM;4BACNC,OAAOb,KAAKc,SAAS,CAACC,IAAI;4BAC1Bd,UAAU,CAACe,IAAMf,SAAS;oCAAE,GAAGD,IAAI;oCAAEc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kCAC/B,cAAA,KAAC3C;4BAAW4B,SAAQ;sCAAY;;;kCAElC,KAAC1B;wBAAKY,MAAM;4BAAEC,IAAI;wBAAE;wBAAG4B,WAAU;kCAC/B,cAAA,KAAC3C;4BAAW4B,SAAQ;sCAAY;;;kCAElC,KAAC1B;wBAAKY,MAAM;4BAAEC,IAAI;wBAAE;;;;0BAEtB,KAAClB;gBAAMoB,KAAK;gBAAK4C,uBAAS,KAACnE;oBAAQoE,QAAQ;oBAACC,aAAY;;0BACrDf,aAAagB,GAAG,CAAC,CAACxD,MAAMyD,kBACvB,KAAC1D;wBAECC,MAAMA;wBACNC,UAAU,CAAC2C,cAA8BF,iBAAiBe,GAAGb;wBAC7D1C,UAAU,IAAM4C,iBAAiBW;uBAH5BA;;0BAOX,KAACxE;gBAAOmC,SAAQ;gBAAWsC,yBAAW,KAAC9D;gBAAYuB,IAAI;oBAAEwC,WAAW;gBAAE;gBAAG1B,SAASgB;0BAC/ER;;;;AAIT"}
1
+ {"version":3,"sources":["../../../src/components/ConditionalPanel.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 React from 'react';\nimport {\n Button,\n Divider,\n Grid2Props as GridProps,\n IconButton,\n MenuItem,\n Stack,\n TextField,\n Tooltip,\n Typography,\n Grid2 as Grid,\n} from '@mui/material';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport { OptionsColorPicker } from '@perses-dev/components';\nimport { CellSettings, renderConditionEditor } from '../models';\n\n// Individual conditional formatting rule component\nexport interface ConditionalRuleProps extends Omit<GridProps, 'onChange'> {\n cell: CellSettings;\n onChange: (cell: CellSettings) => void;\n onDelete: () => void;\n}\n\nexport function ConditionalRule({ cell, onChange, onDelete, ...props }: ConditionalRuleProps) {\n return (\n <Grid container spacing={2} {...props}>\n <Grid size={{ xs: 5 }}>\n <Stack direction=\"row\" gap={1} width=\"100%\">\n <TextField\n select\n label=\"Type\"\n value={cell.condition.kind}\n onChange={(e) => onChange({ ...cell, condition: { kind: e.target.value } } as CellSettings)}\n required\n sx={{ width: '120px' }}\n >\n <MenuItem value=\"Value\">\n <Stack>\n <Typography>Value</Typography>\n {cell.condition.kind !== 'Value' && (\n <Typography variant=\"caption\">Matches an exact text value</Typography>\n )}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Range\">\n <Stack>\n <Typography>Range</Typography>\n {cell.condition.kind !== 'Range' && (\n <Typography variant=\"caption\">Matches against a numerical range</Typography>\n )}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Regex\">\n <Stack>\n <Typography>Regex</Typography>\n {cell.condition.kind !== 'Regex' && (\n <Typography variant=\"caption\">Matches against a regular expression</Typography>\n )}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Misc\">\n <Stack>\n <Typography>Misc</Typography>\n {cell.condition.kind !== 'Misc' && (\n <Typography variant=\"caption\">Matches against empty, null and NaN values</Typography>\n )}\n </Stack>\n </MenuItem>\n </TextField>\n {renderConditionEditor(\n cell.condition,\n (updatedCondition) => onChange({ ...cell, condition: updatedCondition }),\n 'small'\n )}\n </Stack>\n </Grid>\n <Grid size={{ xs: 4 }}>\n <Stack spacing={1}>\n <TextField\n label=\"Display text\"\n value={cell.text}\n onChange={(e) => onChange({ ...cell, text: e.target.value })}\n fullWidth\n size=\"small\"\n />\n <Stack direction=\"row\" spacing={1}>\n <TextField\n label=\"Prefix\"\n placeholder=\"$\"\n value={cell.prefix ?? ''}\n onChange={(e) => onChange({ ...cell, prefix: e.target.value })}\n size=\"small\"\n />\n <TextField\n label=\"Suffix\"\n placeholder=\"%\"\n value={cell.suffix ?? ''}\n onChange={(e) => onChange({ ...cell, suffix: e.target.value })}\n size=\"small\"\n />\n </Stack>\n </Stack>\n </Grid>\n <Grid size={{ xs: 1 }}>\n <Stack direction=\"row\" justifyContent=\"center\" gap={1}>\n {cell.textColor ? (\n <OptionsColorPicker\n label=\"Text Color\"\n color={cell.textColor ?? '#000'}\n onColorChange={(color) => onChange({ ...cell, textColor: color } as CellSettings)}\n onClear={() => onChange({ ...cell, textColor: undefined } as CellSettings)}\n />\n ) : (\n <IconButton onClick={() => onChange({ ...cell, textColor: '#000' })}>\n <AddIcon />\n </IconButton>\n )}\n </Stack>\n </Grid>\n <Grid size={{ xs: 1 }}>\n <Stack direction=\"row\" justifyContent=\"center\">\n {cell.backgroundColor ? (\n <OptionsColorPicker\n label=\"Background Color\"\n color={cell.backgroundColor ?? '#fff'}\n onColorChange={(color) => onChange({ ...cell, backgroundColor: color } as CellSettings)}\n onClear={() => onChange({ ...cell, backgroundColor: undefined } as CellSettings)}\n />\n ) : (\n <IconButton onClick={() => onChange({ ...cell, backgroundColor: '#000' })}>\n <AddIcon />\n </IconButton>\n )}\n </Stack>\n </Grid>\n <Grid size={{ xs: 1 }} textAlign=\"end\">\n <Tooltip title=\"Remove cell settings\" placement=\"top\">\n <IconButton size=\"small\" sx={{ marginLeft: 'auto' }} onClick={onDelete} key=\"delete-cell-button\">\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n </Grid>\n </Grid>\n );\n}\n\n// Complete conditional formatting panel with headers and list management\nexport interface ConditionalPanelProps {\n cellSettings?: CellSettings[];\n onChange: (cellSettings: CellSettings[] | undefined) => void;\n addButtonText?: string;\n}\n\nexport function ConditionalPanel({\n cellSettings = [],\n onChange,\n addButtonText = 'Add Conditional Format',\n}: ConditionalPanelProps) {\n const handleCellChange = (index: number, updatedCell: CellSettings) => {\n const updatedCells = [...cellSettings];\n updatedCells[index] = updatedCell;\n onChange(updatedCells);\n };\n\n const handleCellDelete = (index: number) => {\n const updatedCells = [...cellSettings];\n updatedCells.splice(index, 1);\n onChange(updatedCells.length > 0 ? updatedCells : undefined);\n };\n\n const handleAddCell = () => {\n const updatedCells = [...cellSettings];\n updatedCells.push({ condition: { kind: 'Value', spec: { value: '' } } });\n onChange(updatedCells);\n };\n\n return (\n <Stack spacing={3} sx={{ mt: 2 }}>\n <Grid container spacing={3}>\n <Grid size={{ xs: 5 }}>\n <Typography variant=\"subtitle1\">Condition</Typography>\n </Grid>\n <Grid size={{ xs: 4 }}>\n <Typography variant=\"subtitle1\">Display Text</Typography>\n </Grid>\n <Grid size={{ xs: 1 }} textAlign=\"center\">\n <Typography variant=\"subtitle1\">Color</Typography>\n </Grid>\n <Grid size={{ xs: 1 }} textAlign=\"center\">\n <Typography variant=\"subtitle1\">Background</Typography>\n </Grid>\n <Grid size={{ xs: 1 }}></Grid>\n </Grid>\n <Stack gap={1.5} divider={<Divider flexItem orientation=\"horizontal\" />}>\n {cellSettings.map((cell, i) => (\n <ConditionalRule\n key={i}\n cell={cell}\n onChange={(updatedCell: CellSettings) => handleCellChange(i, updatedCell)}\n onDelete={() => handleCellDelete(i)}\n />\n ))}\n </Stack>\n <Button variant=\"outlined\" startIcon={<AddIcon />} sx={{ marginTop: 1 }} onClick={handleAddCell}>\n {addButtonText}\n </Button>\n </Stack>\n );\n}\n"],"names":["React","Button","Divider","IconButton","MenuItem","Stack","TextField","Tooltip","Typography","Grid2","Grid","DeleteIcon","AddIcon","OptionsColorPicker","renderConditionEditor","ConditionalRule","cell","onChange","onDelete","props","container","spacing","size","xs","direction","gap","width","select","label","value","condition","kind","e","target","required","sx","variant","updatedCondition","text","fullWidth","placeholder","prefix","suffix","justifyContent","textColor","color","onColorChange","onClear","undefined","onClick","backgroundColor","textAlign","title","placement","marginLeft","ConditionalPanel","cellSettings","addButtonText","handleCellChange","index","updatedCell","updatedCells","handleCellDelete","splice","length","handleAddCell","push","spec","mt","divider","flexItem","orientation","map","i","startIcon","marginTop"],"mappings":";AAAA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ACvB,KAAC1D;wBAECC,MAAMA;wBACNC,UAAU,CAAC2C,cAA8BF,iBAAiBe,GAAGb;wBAC7D1C,UAAU,IAAM4C,iBAAiBW;uBAH5BA;;0BAOX,KAACxE;gBAAOmC,SAAQ;gBAAWsC,yBAAW,KAAC9D;gBAAYuB,IAAI;oBAAEwC,WAAW;gBAAE;gBAAG1B,SAASgB;0BAC/ER;;;;AAIT"}
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/EmbeddedPanel.tsx"],"sourcesContent":["// Copyright 2025 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 { QueryDataType, UnknownSpec } from '@perses-dev/core';\nimport { PanelPluginLoader } from '@perses-dev/dashboards';\nimport useResizeObserver from 'use-resize-observer';\nimport { ErrorAlert, ErrorBoundary } from '@perses-dev/components';\n\ninterface EmbeddedPanelProps {\n kind: string;\n spec: UnknownSpec;\n queryResults: Array<PanelData<QueryDataType>>;\n}\n\nexport function EmbeddedPanel({ kind, spec, queryResults }: EmbeddedPanelProps) {\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,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAIjC,SAASA,iBAAiB,QAAQ,yBAAyB;AAC3D,OAAOC,uBAAuB,sBAAsB;AACpD,SAASC,UAAU,EAAEC,aAAa,QAAQ,yBAAyB;AAQnE,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 { PanelData } from '@perses-dev/plugin-system';\nimport { QueryDataType, UnknownSpec } from '@perses-dev/core';\nimport { PanelPluginLoader } from '@perses-dev/dashboards';\nimport useResizeObserver from 'use-resize-observer';\nimport { ErrorAlert, ErrorBoundary } from '@perses-dev/components';\n\ninterface EmbeddedPanelProps {\n kind: string;\n spec: UnknownSpec;\n queryResults: Array<PanelData<QueryDataType>>;\n}\n\nexport function EmbeddedPanel({ kind, spec, queryResults }: EmbeddedPanelProps) {\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;;AAIjC,SAASA,iBAAiB,QAAQ,yBAAyB;AAC3D,OAAOC,uBAAuB,sBAAsB;AACpD,SAASC,UAAU,EAAEC,aAAa,QAAQ,yBAAyB;AAQnE,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,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/TableCellsEditor.tsx"],"sourcesContent":["// Copyright 2024 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 { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { CellSettings, TableOptions } from '../models';\nimport { CellsEditor } from './CellsEditor';\n\nexport type TableCellsEditorProps = OptionsEditorProps<TableOptions>;\n\nexport function TableCellsEditor({ onChange, value }: TableCellsEditorProps): ReactElement {\n function handleCellsChange(cells: CellSettings[]): void {\n onChange({ ...value, cellSettings: cells });\n }\n\n return <CellsEditor cellSettings={value.cellSettings ?? []} onChange={handleCellsChange} />;\n}\n"],"names":["CellsEditor","TableCellsEditor","onChange","value","handleCellsChange","cells","cellSettings"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAKjC,SAASA,WAAW,QAAQ,gBAAgB;AAI5C,OAAO,SAASC,iBAAiB,EAAEC,QAAQ,EAAEC,KAAK,EAAyB;IACzE,SAASC,kBAAkBC,KAAqB;QAC9CH,SAAS;YAAE,GAAGC,KAAK;YAAEG,cAAcD;QAAM;IAC3C;IAEA,qBAAO,KAACL;QAAYM,cAAcH,MAAMG,YAAY,IAAI,EAAE;QAAEJ,UAAUE;;AACxE"}
1
+ {"version":3,"sources":["../../../src/components/TableCellsEditor.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 { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { CellSettings, TableOptions } from '../models';\nimport { CellsEditor } from './CellsEditor';\n\nexport type TableCellsEditorProps = OptionsEditorProps<TableOptions>;\n\nexport function TableCellsEditor({ onChange, value }: TableCellsEditorProps): ReactElement {\n function handleCellsChange(cells: CellSettings[]): void {\n onChange({ ...value, cellSettings: cells });\n }\n\n return <CellsEditor cellSettings={value.cellSettings ?? []} onChange={handleCellsChange} />;\n}\n"],"names":["CellsEditor","TableCellsEditor","onChange","value","handleCellsChange","cells","cellSettings"],"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;;AAKjC,SAASA,WAAW,QAAQ,gBAAgB;AAI5C,OAAO,SAASC,iBAAiB,EAAEC,QAAQ,EAAEC,KAAK,EAAyB;IACzE,SAASC,kBAAkBC,KAAqB;QAC9CH,SAAS;YAAE,GAAGC,KAAK;YAAEG,cAAcD;QAAM;IAC3C;IAEA,qBAAO,KAACL;QAAYM,cAAcH,MAAMG,YAAY,IAAI,EAAE;QAAEJ,UAAUE;;AACxE"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/TableColumnsEditor.tsx"],"sourcesContent":["// Copyright 2024 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 { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { ColumnSettings, TableOptions } from '../models';\nimport { ColumnsEditor } from './ColumnsEditor';\n\nexport type TableColumnsEditorProps = OptionsEditorProps<TableOptions>;\n\nexport function TableColumnsEditor({ onChange, value }: TableColumnsEditorProps): ReactElement {\n function handleColumnsChange(columns: ColumnSettings[]): void {\n onChange({ ...value, columnSettings: columns });\n }\n\n return <ColumnsEditor columnSettings={value.columnSettings ?? []} onChange={handleColumnsChange} />;\n}\n"],"names":["ColumnsEditor","TableColumnsEditor","onChange","value","handleColumnsChange","columns","columnSettings"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAKjC,SAASA,aAAa,QAAQ,kBAAkB;AAIhD,OAAO,SAASC,mBAAmB,EAAEC,QAAQ,EAAEC,KAAK,EAA2B;IAC7E,SAASC,oBAAoBC,OAAyB;QACpDH,SAAS;YAAE,GAAGC,KAAK;YAAEG,gBAAgBD;QAAQ;IAC/C;IAEA,qBAAO,KAACL;QAAcM,gBAAgBH,MAAMG,cAAc,IAAI,EAAE;QAAEJ,UAAUE;;AAC9E"}
1
+ {"version":3,"sources":["../../../src/components/TableColumnsEditor.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 { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { ColumnSettings, TableOptions } from '../models';\nimport { ColumnsEditor } from './ColumnsEditor';\n\nexport type TableColumnsEditorProps = OptionsEditorProps<TableOptions>;\n\nexport function TableColumnsEditor({ onChange, value }: TableColumnsEditorProps): ReactElement {\n function handleColumnsChange(columns: ColumnSettings[]): void {\n onChange({ ...value, columnSettings: columns });\n }\n\n return <ColumnsEditor columnSettings={value.columnSettings ?? []} onChange={handleColumnsChange} />;\n}\n"],"names":["ColumnsEditor","TableColumnsEditor","onChange","value","handleColumnsChange","columns","columnSettings"],"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;;AAKjC,SAASA,aAAa,QAAQ,kBAAkB;AAIhD,OAAO,SAASC,mBAAmB,EAAEC,QAAQ,EAAEC,KAAK,EAA2B;IAC7E,SAASC,oBAAoBC,OAAyB;QACpDH,SAAS;YAAE,GAAGC,KAAK;YAAEG,gBAAgBD;QAAQ;IAC/C;IAEA,qBAAO,KAACL;QAAcM,gBAAgBH,MAAMG,cAAc,IAAI,EAAE;QAAEJ,UAAUE;;AAC9E"}
@@ -0,0 +1,4 @@
1
+ import { ReactElement } from 'react';
2
+ import { TableSettingsEditorProps } from '../models';
3
+ export declare function TableItemSelectionActionsEditor({ value, onChange }: TableSettingsEditorProps): ReactElement;
4
+ //# sourceMappingURL=TableItemSelectionActionsEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableItemSelectionActionsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/TableItemSelectionActionsEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,wBAAgB,+BAA+B,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,wBAAwB,GAAG,YAAY,CAiB3G"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { ItemSelectionActionsEditor } from '@perses-dev/plugin-system';
15
+ export function TableItemSelectionActionsEditor({ value, onChange }) {
16
+ function handleActionsChange(actions) {
17
+ onChange({
18
+ ...value,
19
+ actions: actions
20
+ });
21
+ }
22
+ function handleSelectionChange(selection) {
23
+ onChange({
24
+ ...value,
25
+ selection: selection
26
+ });
27
+ }
28
+ return /*#__PURE__*/ _jsx(ItemSelectionActionsEditor, {
29
+ actionOptions: value.actions,
30
+ onChangeActions: handleActionsChange,
31
+ selectionOptions: value.selection,
32
+ onChangeSelection: handleSelectionChange
33
+ });
34
+ }
35
+
36
+ //# sourceMappingURL=TableItemSelectionActionsEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/TableItemSelectionActionsEditor.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 { TableSettingsEditorProps } from '../models';\n\nexport function TableItemSelectionActionsEditor({ value, onChange }: TableSettingsEditorProps): 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","TableItemSelectionActionsEditor","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,gCAAgC,EAAEC,KAAK,EAAEC,QAAQ,EAA4B;IAC3F,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,6 +1,6 @@
1
+ import { TimeSeriesData } from '@perses-dev/core';
1
2
  import { PanelProps } from '@perses-dev/plugin-system';
2
3
  import { ReactElement } from 'react';
3
- import { TimeSeriesData } from '@perses-dev/core';
4
4
  import { TableOptions } from '../models';
5
5
  export declare function getTablePanelQueryOptions(spec: TableOptions): {
6
6
  mode: 'instant' | 'range';
@@ -1 +1 @@
1
- {"version":3,"file":"TablePanel.d.ts","sourceRoot":"","sources":["../../../src/components/TablePanel.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAa,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAE,YAAY,EAAgC,MAAM,OAAO,CAAC;AACnE,OAAO,EAAkD,cAAc,EAAiB,MAAM,kBAAkB,CAAC;AAGjH,OAAO,EAAkB,YAAY,EAAiC,MAAM,WAAW,CAAC;AAuKxF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,YAAY,GAAG;IAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAA;CAAE,CAK3F;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAElE,wBAAgB,UAAU,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CAmYrG"}
1
+ {"version":3,"file":"TablePanel.d.ts","sourceRoot":"","sources":["../../../src/components/TablePanel.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAkD,cAAc,EAAiB,MAAM,kBAAkB,CAAC;AAEjH,OAAO,EAGL,UAAU,EAIX,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAqD,MAAM,OAAO,CAAC;AACxF,OAAO,EAAiD,YAAY,EAAE,MAAM,WAAW,CAAC;AA+KxF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,YAAY,GAAG;IAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAA;CAAE,CAK3F;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAElE,wBAAgB,UAAU,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CAybrG"}
@@ -1,4 +1,5 @@
1
- // Copyright 2024 The Perses Authors
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
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.
4
5
  // You may obtain a copy of the License at
@@ -10,11 +11,12 @@
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, Fragment as _Fragment } from "react/jsx-runtime";
14
- import { Table } from '@perses-dev/components';
15
- import { useEffect, useMemo, useState } from 'react';
14
+ import { Box, Typography, useTheme } from '@mui/material';
15
+ import { Table, useSelection } from '@perses-dev/components';
16
16
  import { formatValue, transformData } from '@perses-dev/core';
17
- import { useTheme, Typography, Box } from '@mui/material';
17
+ import { useSelectionItemActions } from '@perses-dev/dashboards';
18
+ import { replaceVariablesInString, useAllVariableValues } from '@perses-dev/plugin-system';
19
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
18
20
  import { evaluateConditionalFormatting } from '../models';
19
21
  import { EmbeddedPanel } from './EmbeddedPanel';
20
22
  function generateCellContentConfig(column) {
@@ -174,13 +176,17 @@ function ColumnFilterDropdown({ allValues, selectedValues, onFilterChange, theme
174
176
  * Generate column config from column definitions, if a column has multiple definitions, the first one will be used.
175
177
  * If column is hidden, return undefined.
176
178
  * If column do not have a definition, return a default column config.
177
- */ function generateColumnConfig(name, columnSettings) {
179
+ */ function generateColumnConfig(name, columnSettings, allVariables) {
178
180
  for (const column of columnSettings){
179
181
  if (column.name === name) {
180
182
  if (column.hide) {
181
183
  return undefined;
182
184
  }
183
185
  const { name, header, headerDescription, enableSorting, width, align, dataLink } = column;
186
+ const modifiedDataLink = dataLink ? {
187
+ ...dataLink,
188
+ url: replaceVariablesInString(dataLink.url, allVariables)
189
+ } : undefined;
184
190
  return {
185
191
  accessorKey: name,
186
192
  header: header ?? name,
@@ -188,7 +194,7 @@ function ColumnFilterDropdown({ allValues, selectedValues, onFilterChange, theme
188
194
  enableSorting,
189
195
  width,
190
196
  align,
191
- dataLink,
197
+ dataLink: modifiedDataLink,
192
198
  ...generateCellContentConfig(column)
193
199
  };
194
200
  }
@@ -206,6 +212,48 @@ export function getTablePanelQueryOptions(spec) {
206
212
  }
207
213
  export function TablePanel({ contentDimensions, spec, queryResults }) {
208
214
  const theme = useTheme();
215
+ const allVariables = useAllVariableValues();
216
+ const selectionEnabled = spec.selection?.enabled ?? false;
217
+ const { selectionMap, setSelection, clearSelection } = useSelection();
218
+ const itemActionsConfig = spec.actions ? spec.actions : undefined;
219
+ const itemActionsListConfig = itemActionsConfig?.enabled && itemActionsConfig.displayWithItem ? itemActionsConfig.actionsList : [];
220
+ const { getItemActionButtons, confirmDialog, actionButtons } = useSelectionItemActions({
221
+ actions: itemActionsListConfig,
222
+ variableState: allVariables
223
+ });
224
+ const filteredDataRef = useRef([]);
225
+ // Convert selectionMap to TanStack's RowSelectionState format
226
+ const rowSelection = useMemo(()=>{
227
+ const result = {};
228
+ selectionMap.forEach((_, id)=>{
229
+ result[id] = true;
230
+ });
231
+ return result;
232
+ }, [
233
+ selectionMap
234
+ ]);
235
+ const handleRowSelectionChange = useCallback((newRowSelection)=>{
236
+ const newSelection = [];
237
+ for (const [id, isSelected] of Object.entries(newRowSelection)){
238
+ if (isSelected) {
239
+ const index = parseInt(id, 10);
240
+ if (filteredDataRef.current[index] !== undefined) {
241
+ newSelection.push({
242
+ id,
243
+ item: filteredDataRef.current[index]
244
+ });
245
+ }
246
+ }
247
+ }
248
+ if (newSelection.length === 0) {
249
+ clearSelection();
250
+ } else {
251
+ setSelection(newSelection);
252
+ }
253
+ }, [
254
+ setSelection,
255
+ clearSelection
256
+ ]);
209
257
  // TODO: handle other query types
210
258
  const queryMode = getTablePanelQueryOptions(spec).mode;
211
259
  const rawData = useMemo(()=>{
@@ -256,7 +304,10 @@ export function TablePanel({ contentDimensions, spec, queryResults }) {
256
304
  spec.columnSettings
257
305
  ]);
258
306
  // Transform will be applied by their orders on the original data
259
- const data = transformData(rawData, spec.transforms ?? []);
307
+ const data = useMemo(()=>transformData(rawData, spec.transforms ?? []), [
308
+ rawData,
309
+ spec.transforms
310
+ ]);
260
311
  const keys = useMemo(()=>{
261
312
  const result = [];
262
313
  for (const entry of data){
@@ -289,7 +340,7 @@ export function TablePanel({ contentDimensions, spec, queryResults }) {
289
340
  // Process columnSettings if they exist
290
341
  for (const columnSetting of spec.columnSettings ?? []){
291
342
  if (customizedColumns.has(columnSetting.name)) continue; // Skip duplicates
292
- const columnConfig = generateColumnConfig(columnSetting.name, spec.columnSettings ?? []);
343
+ const columnConfig = generateColumnConfig(columnSetting.name, spec.columnSettings ?? [], allVariables);
293
344
  if (columnConfig !== undefined) {
294
345
  columns.push(columnConfig);
295
346
  customizedColumns.add(columnSetting.name);
@@ -299,7 +350,7 @@ export function TablePanel({ contentDimensions, spec, queryResults }) {
299
350
  if (!spec.defaultColumnHidden) {
300
351
  for (const key of keys){
301
352
  if (!customizedColumns.has(key)) {
302
- const columnConfig = generateColumnConfig(key, spec.columnSettings ?? []);
353
+ const columnConfig = generateColumnConfig(key, spec.columnSettings ?? [], allVariables);
303
354
  if (columnConfig !== undefined) {
304
355
  columns.push(columnConfig);
305
356
  }
@@ -310,7 +361,8 @@ export function TablePanel({ contentDimensions, spec, queryResults }) {
310
361
  }, [
311
362
  keys,
312
363
  spec.columnSettings,
313
- spec.defaultColumnHidden
364
+ spec.defaultColumnHidden,
365
+ allVariables
314
366
  ]);
315
367
  // Generate cell settings that will be used by the table to render cells (text color, background color, ...)
316
368
  const cellConfigs = useMemo(()=>{
@@ -442,6 +494,8 @@ export function TablePanel({ contentDimensions, spec, queryResults }) {
442
494
  columnFilters,
443
495
  spec.enableFiltering
444
496
  ]);
497
+ // Keep ref in sync with filtered data for use in selection handler
498
+ filteredDataRef.current = filteredData;
445
499
  const [pagination, setPagination] = useState(spec.pagination ? {
446
500
  pageIndex: 0,
447
501
  pageSize: 10
@@ -478,6 +532,7 @@ export function TablePanel({ contentDimensions, spec, queryResults }) {
478
532
  }
479
533
  return /*#__PURE__*/ _jsxs(_Fragment, {
480
534
  children: [
535
+ confirmDialog,
481
536
  spec.enableFiltering && /*#__PURE__*/ _jsx("div", {
482
537
  style: {
483
538
  display: 'flex',
@@ -572,7 +627,15 @@ export function TablePanel({ contentDimensions, spec, queryResults }) {
572
627
  sorting: sorting,
573
628
  onSortingChange: setSorting,
574
629
  pagination: pagination,
575
- onPaginationChange: setPagination
630
+ onPaginationChange: setPagination,
631
+ checkboxSelection: selectionEnabled,
632
+ rowSelection: rowSelection,
633
+ onRowSelectionChange: handleRowSelectionChange,
634
+ getItemActions: ({ id, data })=>getItemActionButtons({
635
+ id,
636
+ data: data
637
+ }),
638
+ hasItemActions: actionButtons && actionButtons.length > 0
576
639
  })
577
640
  ]
578
641
  });