@perses-dev/table-plugin 0.9.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/__mf/css/async/3061.d3010b86.css +1 -0
  2. package/__mf/css/async/5442.d3010b86.css +1 -0
  3. package/__mf/css/async/7823.d3010b86.css +1 -0
  4. package/__mf/js/Table.7e37b83d.js +6 -0
  5. package/__mf/js/async/1432.4dcbe7e3.js +1 -0
  6. package/__mf/js/async/1490.7aa42bc8.js +22 -0
  7. package/__mf/js/async/1616.7a74f4ef.js +1 -0
  8. package/__mf/js/async/2043.fdebf89c.js +2 -0
  9. package/__mf/js/async/3827.1b39b042.js +38 -0
  10. package/__mf/js/async/392.c2307fe5.js +2 -0
  11. package/__mf/js/async/{1964.ad4fb2b0.js → 4121.8e97ef88.js} +2 -2
  12. package/__mf/js/async/4761.08da9107.js +1 -0
  13. package/__mf/js/async/{2651.4ede9028.js → 5002.3189d214.js} +1 -1
  14. package/__mf/js/async/{1640.c1ed5a05.js → 5019.5318688a.js} +1 -1
  15. package/__mf/js/async/5071.91e1c002.js +1 -0
  16. package/__mf/js/async/5501.fa3f80e1.js +1 -0
  17. package/__mf/js/async/{5214.00911b97.js → 5587.f5f2b0cc.js} +1 -1
  18. package/__mf/js/async/5806.44fbc2a8.js +1 -0
  19. package/__mf/js/async/6274.14683c28.js +2 -0
  20. package/__mf/js/async/6283.e044c368.js +2 -0
  21. package/__mf/js/async/6587.d2b9768c.js +110 -0
  22. package/__mf/js/async/6753.032ce611.js +1 -0
  23. package/__mf/js/async/7142.5d923107.js +1 -0
  24. package/__mf/js/async/7177.356298ae.js +1 -0
  25. package/__mf/js/async/7192.66c9e3a5.js +1 -0
  26. package/__mf/js/async/7208.125848cf.js +7 -0
  27. package/__mf/js/async/7417.86d0bc09.js +1 -0
  28. package/__mf/js/async/7968.a66bfadb.js +1 -0
  29. package/__mf/js/async/7978.a19f5a4f.js +1 -0
  30. package/__mf/js/async/8356.8ae40b6a.js +1 -0
  31. package/__mf/js/async/8470.1b8b20ff.js +2 -0
  32. package/__mf/js/async/8728.546704f2.js +1 -0
  33. package/__mf/js/async/873.a7310675.js +1 -0
  34. package/__mf/js/async/9235.eee50e10.js +1 -0
  35. package/__mf/js/async/9355.8b0c6885.js +2 -0
  36. package/__mf/js/async/941.333875f4.js +2 -0
  37. package/__mf/js/async/9588.7b021071.js +1 -0
  38. package/__mf/js/async/__federation_expose_Table.4836d198.js +1 -0
  39. package/__mf/js/async/lib-router.8fd59130.js +2 -0
  40. package/__mf/js/main.289caaea.js +6 -0
  41. package/lib/Table.d.ts +2 -2
  42. package/lib/Table.d.ts.map +1 -1
  43. package/lib/Table.js +2 -6
  44. package/lib/Table.js.map +1 -1
  45. package/lib/bootstrap.js +1 -1
  46. package/lib/bootstrap.js.map +1 -1
  47. package/lib/cjs/Table.js +9 -13
  48. package/lib/cjs/components/CellsEditor/CellsEditor.js +30 -0
  49. package/lib/cjs/{CellsEditor → components/CellsEditor}/index.js +0 -1
  50. package/lib/cjs/components/ColumnsEditor/ColumnEditor.js +241 -0
  51. package/lib/cjs/{CellsEditor/CellEditor.js → components/ConditionalPanel.js} +167 -197
  52. package/lib/cjs/components/TablePanel.js +576 -0
  53. package/lib/cjs/{TableSettingsEditor.js → components/TableSettingsEditor.js} +32 -4
  54. package/lib/cjs/components/index.js +37 -0
  55. package/lib/cjs/index-federation.js +12 -12
  56. package/lib/cjs/index.js +2 -9
  57. package/lib/cjs/models/index.js +31 -0
  58. package/lib/cjs/{table-model.js → models/model.js} +1 -12
  59. package/lib/cjs/models/table-model.js +252 -0
  60. package/lib/cjs/test/mock-query-results.js +7 -7
  61. package/lib/{CellsEditor → components/CellsEditor}/CellsEditor.d.ts +1 -1
  62. package/lib/components/CellsEditor/CellsEditor.d.ts.map +1 -0
  63. package/lib/components/CellsEditor/CellsEditor.js +22 -0
  64. package/lib/components/CellsEditor/CellsEditor.js.map +1 -0
  65. package/lib/components/CellsEditor/index.d.ts +2 -0
  66. package/lib/components/CellsEditor/index.d.ts.map +1 -0
  67. package/lib/{CellsEditor → components/CellsEditor}/index.js +0 -1
  68. package/lib/components/CellsEditor/index.js.map +1 -0
  69. package/lib/{ColumnsEditor → components/ColumnsEditor}/ColumnEditor.d.ts +1 -1
  70. package/lib/components/ColumnsEditor/ColumnEditor.d.ts.map +1 -0
  71. package/lib/components/ColumnsEditor/ColumnEditor.js +233 -0
  72. package/lib/components/ColumnsEditor/ColumnEditor.js.map +1 -0
  73. package/lib/components/ColumnsEditor/ColumnEditorContainer.d.ts.map +1 -0
  74. package/lib/{ColumnsEditor → components/ColumnsEditor}/ColumnEditorContainer.js +1 -1
  75. package/lib/components/ColumnsEditor/ColumnEditorContainer.js.map +1 -0
  76. package/lib/{ColumnsEditor → components/ColumnsEditor}/ColumnsEditor.d.ts +1 -1
  77. package/lib/components/ColumnsEditor/ColumnsEditor.d.ts.map +1 -0
  78. package/lib/{ColumnsEditor → components/ColumnsEditor}/ColumnsEditor.js +1 -1
  79. package/lib/components/ColumnsEditor/ColumnsEditor.js.map +1 -0
  80. package/lib/components/ColumnsEditor/index.d.ts.map +1 -0
  81. package/lib/components/ColumnsEditor/index.js.map +1 -0
  82. package/lib/components/ConditionalPanel.d.ts +15 -0
  83. package/lib/components/ConditionalPanel.d.ts.map +1 -0
  84. package/lib/{CellsEditor/CellEditor.js → components/ConditionalPanel.js} +159 -197
  85. package/lib/components/ConditionalPanel.js.map +1 -0
  86. package/lib/components/EmbeddedPanel.d.ts.map +1 -0
  87. package/lib/components/EmbeddedPanel.js.map +1 -0
  88. package/lib/{TableCellsEditor.d.ts → components/TableCellsEditor.d.ts} +1 -1
  89. package/lib/components/TableCellsEditor.d.ts.map +1 -0
  90. package/lib/components/TableCellsEditor.js.map +1 -0
  91. package/lib/{TableColumnsEditor.d.ts → components/TableColumnsEditor.d.ts} +1 -1
  92. package/lib/components/TableColumnsEditor.d.ts.map +1 -0
  93. package/lib/components/TableColumnsEditor.js.map +1 -0
  94. package/lib/{TablePanel.d.ts → components/TablePanel.d.ts} +1 -1
  95. package/lib/components/TablePanel.d.ts.map +1 -0
  96. package/lib/components/TablePanel.js +560 -0
  97. package/lib/components/TablePanel.js.map +1 -0
  98. package/lib/{TableSettingsEditor.d.ts → components/TableSettingsEditor.d.ts} +1 -1
  99. package/lib/components/TableSettingsEditor.d.ts.map +1 -0
  100. package/lib/{TableSettingsEditor.js → components/TableSettingsEditor.js} +33 -5
  101. package/lib/components/TableSettingsEditor.js.map +1 -0
  102. package/lib/{TableTransformsEditor.d.ts → components/TableTransformsEditor.d.ts} +1 -1
  103. package/lib/components/TableTransformsEditor.d.ts.map +1 -0
  104. package/lib/{TableTransformsEditor.js → components/TableTransformsEditor.js} +1 -1
  105. package/lib/components/TableTransformsEditor.js.map +1 -0
  106. package/lib/components/index.d.ts +9 -0
  107. package/lib/components/index.d.ts.map +1 -0
  108. package/lib/components/index.js +22 -0
  109. package/lib/components/index.js.map +1 -0
  110. package/lib/index.d.ts +2 -9
  111. package/lib/index.d.ts.map +1 -1
  112. package/lib/index.js +2 -9
  113. package/lib/index.js.map +1 -1
  114. package/lib/models/index.d.ts +3 -0
  115. package/lib/models/index.d.ts.map +1 -0
  116. package/lib/{table-model.js → models/index.js} +4 -9
  117. package/lib/models/index.js.map +1 -0
  118. package/lib/models/model.d.ts.map +1 -0
  119. package/lib/models/model.js +15 -0
  120. package/lib/models/model.js.map +1 -0
  121. package/lib/{table-model.d.ts → models/table-model.d.ts} +24 -1
  122. package/lib/models/table-model.d.ts.map +1 -0
  123. package/lib/models/table-model.js +233 -0
  124. package/lib/models/table-model.js.map +1 -0
  125. package/mf-manifest.json +44 -45
  126. package/mf-stats.json +45 -46
  127. package/package.json +5 -5
  128. package/__mf/css/async/2341.cbbd94a8.css +0 -1
  129. package/__mf/css/async/5263.cbbd94a8.css +0 -1
  130. package/__mf/css/async/6759.cbbd94a8.css +0 -1
  131. package/__mf/js/Table.09045c91.js +0 -5
  132. package/__mf/js/async/1143.68727fe6.js +0 -1
  133. package/__mf/js/async/2292.12f77288.js +0 -2
  134. package/__mf/js/async/2854.fc0ce4ac.js +0 -110
  135. package/__mf/js/async/3224.5efdac43.js +0 -1
  136. package/__mf/js/async/3391.62c7afd4.js +0 -73
  137. package/__mf/js/async/3863.5ed15409.js +0 -2
  138. package/__mf/js/async/3960.ad46df53.js +0 -2
  139. package/__mf/js/async/3980.17fb5371.js +0 -2
  140. package/__mf/js/async/4075.e2a2c230.js +0 -1
  141. package/__mf/js/async/4238.ea9515aa.js +0 -1
  142. package/__mf/js/async/4300.fc319dfb.js +0 -38
  143. package/__mf/js/async/4368.3e460b07.js +0 -1
  144. package/__mf/js/async/4483.b6379137.js +0 -1
  145. package/__mf/js/async/5061.85655462.js +0 -2
  146. package/__mf/js/async/5377.6522c49a.js +0 -1
  147. package/__mf/js/async/5409.524589b2.js +0 -1
  148. package/__mf/js/async/5981.91033d82.js +0 -2
  149. package/__mf/js/async/6284.5f775177.js +0 -1
  150. package/__mf/js/async/6292.c204d39b.js +0 -1
  151. package/__mf/js/async/6770.94607b71.js +0 -1
  152. package/__mf/js/async/694.20d8be37.js +0 -1
  153. package/__mf/js/async/738.3929068d.js +0 -1
  154. package/__mf/js/async/7740.4fee7abb.js +0 -1
  155. package/__mf/js/async/8313.b86a056a.js +0 -7
  156. package/__mf/js/async/8488.9f177839.js +0 -1
  157. package/__mf/js/async/8599.4f1f88c0.js +0 -1
  158. package/__mf/js/async/9010.aaf984f3.js +0 -1
  159. package/__mf/js/async/9173.c646dd1e.js +0 -2
  160. package/__mf/js/async/9509.1c4313e0.js +0 -1
  161. package/__mf/js/async/9667.211c6bdb.js +0 -1
  162. package/__mf/js/async/__federation_expose_Table.3668e352.js +0 -1
  163. package/__mf/js/async/lib-router.f3ef5227.js +0 -2
  164. package/__mf/js/main.0cb08842.js +0 -5
  165. package/lib/CellsEditor/CellEditor.d.ts +0 -10
  166. package/lib/CellsEditor/CellEditor.d.ts.map +0 -1
  167. package/lib/CellsEditor/CellEditor.js.map +0 -1
  168. package/lib/CellsEditor/CellsEditor.d.ts.map +0 -1
  169. package/lib/CellsEditor/CellsEditor.js +0 -123
  170. package/lib/CellsEditor/CellsEditor.js.map +0 -1
  171. package/lib/CellsEditor/index.d.ts +0 -3
  172. package/lib/CellsEditor/index.d.ts.map +0 -1
  173. package/lib/CellsEditor/index.js.map +0 -1
  174. package/lib/ColumnsEditor/ColumnEditor.d.ts.map +0 -1
  175. package/lib/ColumnsEditor/ColumnEditor.js +0 -213
  176. package/lib/ColumnsEditor/ColumnEditor.js.map +0 -1
  177. package/lib/ColumnsEditor/ColumnEditorContainer.d.ts.map +0 -1
  178. package/lib/ColumnsEditor/ColumnEditorContainer.js.map +0 -1
  179. package/lib/ColumnsEditor/ColumnsEditor.d.ts.map +0 -1
  180. package/lib/ColumnsEditor/ColumnsEditor.js.map +0 -1
  181. package/lib/ColumnsEditor/index.d.ts.map +0 -1
  182. package/lib/ColumnsEditor/index.js.map +0 -1
  183. package/lib/EmbeddedPanel.d.ts.map +0 -1
  184. package/lib/EmbeddedPanel.js.map +0 -1
  185. package/lib/TableCellsEditor.d.ts.map +0 -1
  186. package/lib/TableCellsEditor.js.map +0 -1
  187. package/lib/TableColumnsEditor.d.ts.map +0 -1
  188. package/lib/TableColumnsEditor.js.map +0 -1
  189. package/lib/TablePanel.d.ts.map +0 -1
  190. package/lib/TablePanel.js +0 -325
  191. package/lib/TablePanel.js.map +0 -1
  192. package/lib/TableSettingsEditor.d.ts.map +0 -1
  193. package/lib/TableSettingsEditor.js.map +0 -1
  194. package/lib/TableTransformsEditor.d.ts.map +0 -1
  195. package/lib/TableTransformsEditor.js.map +0 -1
  196. package/lib/cjs/CellsEditor/CellsEditor.js +0 -136
  197. package/lib/cjs/ColumnsEditor/ColumnEditor.js +0 -221
  198. package/lib/cjs/TablePanel.js +0 -341
  199. package/lib/cjs/model.js +0 -4
  200. package/lib/model.d.ts.map +0 -1
  201. package/lib/model.js +0 -3
  202. package/lib/model.js.map +0 -1
  203. package/lib/table-model.d.ts.map +0 -1
  204. package/lib/table-model.js.map +0 -1
  205. /package/__mf/js/async/{3391.62c7afd4.js.LICENSE.txt → 1490.7aa42bc8.js.LICENSE.txt} +0 -0
  206. /package/__mf/js/async/{2292.12f77288.js.LICENSE.txt → 2043.fdebf89c.js.LICENSE.txt} +0 -0
  207. /package/__mf/js/async/{5981.91033d82.js.LICENSE.txt → 392.c2307fe5.js.LICENSE.txt} +0 -0
  208. /package/__mf/js/async/{1964.ad4fb2b0.js.LICENSE.txt → 4121.8e97ef88.js.LICENSE.txt} +0 -0
  209. /package/__mf/js/async/{3960.ad46df53.js.LICENSE.txt → 6274.14683c28.js.LICENSE.txt} +0 -0
  210. /package/__mf/js/async/{3980.17fb5371.js.LICENSE.txt → 6283.e044c368.js.LICENSE.txt} +0 -0
  211. /package/__mf/js/async/{2854.fc0ce4ac.js.LICENSE.txt → 6587.d2b9768c.js.LICENSE.txt} +0 -0
  212. /package/__mf/js/async/{8313.b86a056a.js.LICENSE.txt → 7208.125848cf.js.LICENSE.txt} +0 -0
  213. /package/__mf/js/async/{9173.c646dd1e.js.LICENSE.txt → 8470.1b8b20ff.js.LICENSE.txt} +0 -0
  214. /package/__mf/js/async/{5061.85655462.js.LICENSE.txt → 9355.8b0c6885.js.LICENSE.txt} +0 -0
  215. /package/__mf/js/async/{3863.5ed15409.js.LICENSE.txt → 941.333875f4.js.LICENSE.txt} +0 -0
  216. /package/__mf/js/async/{lib-router.f3ef5227.js.LICENSE.txt → lib-router.8fd59130.js.LICENSE.txt} +0 -0
  217. /package/lib/cjs/{ColumnsEditor → components/ColumnsEditor}/ColumnEditorContainer.js +0 -0
  218. /package/lib/cjs/{ColumnsEditor → components/ColumnsEditor}/ColumnsEditor.js +0 -0
  219. /package/lib/cjs/{ColumnsEditor → components/ColumnsEditor}/index.js +0 -0
  220. /package/lib/cjs/{EmbeddedPanel.js → components/EmbeddedPanel.js} +0 -0
  221. /package/lib/cjs/{TableCellsEditor.js → components/TableCellsEditor.js} +0 -0
  222. /package/lib/cjs/{TableColumnsEditor.js → components/TableColumnsEditor.js} +0 -0
  223. /package/lib/cjs/{TableTransformsEditor.js → components/TableTransformsEditor.js} +0 -0
  224. /package/lib/{ColumnsEditor → components/ColumnsEditor}/ColumnEditorContainer.d.ts +0 -0
  225. /package/lib/{ColumnsEditor → components/ColumnsEditor}/index.d.ts +0 -0
  226. /package/lib/{ColumnsEditor → components/ColumnsEditor}/index.js +0 -0
  227. /package/lib/{EmbeddedPanel.d.ts → components/EmbeddedPanel.d.ts} +0 -0
  228. /package/lib/{EmbeddedPanel.js → components/EmbeddedPanel.js} +0 -0
  229. /package/lib/{TableCellsEditor.js → components/TableCellsEditor.js} +0 -0
  230. /package/lib/{TableColumnsEditor.js → components/TableColumnsEditor.js} +0 -0
  231. /package/lib/{model.d.ts → models/model.d.ts} +0 -0
@@ -1,185 +1,11 @@
1
- // Copyright 2024 The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- import { IconButton, MenuItem, Stack, TextField, Tooltip, Typography, Grid2 as Grid } from '@mui/material';
2
+ import React from 'react';
3
+ import { Button, Divider, IconButton, MenuItem, Stack, TextField, Tooltip, Typography, Grid2 as Grid } from '@mui/material';
15
4
  import DeleteIcon from 'mdi-material-ui/DeleteOutline';
5
+ import AddIcon from 'mdi-material-ui/Plus';
16
6
  import { OptionsColorPicker } from '@perses-dev/components';
17
- import PlusIcon from 'mdi-material-ui/Plus';
18
- function ConditionEditor({ condition, onChange, ...props }) {
19
- if (condition.kind === 'Value') {
20
- return /*#__PURE__*/ _jsx(Stack, {
21
- gap: 1,
22
- direction: "row",
23
- ...props,
24
- children: /*#__PURE__*/ _jsx(TextField, {
25
- label: "Value",
26
- placeholder: "Exact value",
27
- value: condition.spec?.value ?? '',
28
- onChange: (e)=>onChange({
29
- ...condition,
30
- spec: {
31
- value: e.target.value
32
- }
33
- }),
34
- fullWidth: true
35
- })
36
- });
37
- } else if (condition.kind === 'Range') {
38
- return /*#__PURE__*/ _jsxs(Stack, {
39
- gap: 1,
40
- direction: "row",
41
- ...props,
42
- children: [
43
- /*#__PURE__*/ _jsx(TextField, {
44
- label: "From",
45
- placeholder: "Start of range",
46
- value: condition.spec?.min ?? '',
47
- onChange: (e)=>onChange({
48
- ...condition,
49
- spec: {
50
- ...condition.spec,
51
- min: +e.target.value
52
- }
53
- }),
54
- fullWidth: true
55
- }),
56
- /*#__PURE__*/ _jsx(TextField, {
57
- label: "To",
58
- placeholder: "End of range (inclusive)",
59
- value: condition.spec?.max ?? '',
60
- onChange: (e)=>onChange({
61
- ...condition,
62
- spec: {
63
- ...condition.spec,
64
- max: +e.target.value
65
- }
66
- }),
67
- fullWidth: true
68
- })
69
- ]
70
- });
71
- } else if (condition.kind === 'Regex') {
72
- return /*#__PURE__*/ _jsx(Stack, {
73
- gap: 1,
74
- direction: "row",
75
- ...props,
76
- children: /*#__PURE__*/ _jsx(TextField, {
77
- label: "Regular Expression",
78
- placeholder: "JavaScript regular expression",
79
- value: condition.spec?.expr ?? '',
80
- onChange: (e)=>onChange({
81
- ...condition,
82
- spec: {
83
- expr: e.target.value
84
- }
85
- }),
86
- fullWidth: true
87
- })
88
- });
89
- } else if (condition.kind === 'Misc') {
90
- return /*#__PURE__*/ _jsx(Stack, {
91
- gap: 1,
92
- direction: "row",
93
- ...props,
94
- children: /*#__PURE__*/ _jsxs(TextField, {
95
- select: true,
96
- label: "Value",
97
- value: condition.spec?.value ?? '',
98
- onChange: (e)=>onChange({
99
- ...condition,
100
- spec: {
101
- value: e.target.value
102
- }
103
- }),
104
- fullWidth: true,
105
- children: [
106
- /*#__PURE__*/ _jsx(MenuItem, {
107
- value: "empty",
108
- children: /*#__PURE__*/ _jsxs(Stack, {
109
- children: [
110
- /*#__PURE__*/ _jsx(Typography, {
111
- children: "Empty"
112
- }),
113
- /*#__PURE__*/ _jsx(Typography, {
114
- variant: "caption",
115
- children: "Matches empty string"
116
- })
117
- ]
118
- })
119
- }),
120
- /*#__PURE__*/ _jsx(MenuItem, {
121
- value: "null",
122
- children: /*#__PURE__*/ _jsxs(Stack, {
123
- children: [
124
- /*#__PURE__*/ _jsx(Typography, {
125
- children: "Null"
126
- }),
127
- /*#__PURE__*/ _jsx(Typography, {
128
- variant: "caption",
129
- children: "Matches null or undefined"
130
- })
131
- ]
132
- })
133
- }),
134
- /*#__PURE__*/ _jsx(MenuItem, {
135
- value: "NaN",
136
- children: /*#__PURE__*/ _jsxs(Stack, {
137
- children: [
138
- /*#__PURE__*/ _jsx(Typography, {
139
- children: "NaN"
140
- }),
141
- /*#__PURE__*/ _jsx(Typography, {
142
- variant: "caption",
143
- children: "Matches Not a Number value"
144
- })
145
- ]
146
- })
147
- }),
148
- /*#__PURE__*/ _jsx(MenuItem, {
149
- value: "true",
150
- children: /*#__PURE__*/ _jsxs(Stack, {
151
- children: [
152
- /*#__PURE__*/ _jsx(Typography, {
153
- children: "True"
154
- }),
155
- /*#__PURE__*/ _jsx(Typography, {
156
- variant: "caption",
157
- children: "Matches true boolean"
158
- })
159
- ]
160
- })
161
- }),
162
- /*#__PURE__*/ _jsx(MenuItem, {
163
- value: "false",
164
- children: /*#__PURE__*/ _jsxs(Stack, {
165
- children: [
166
- /*#__PURE__*/ _jsx(Typography, {
167
- children: "False"
168
- }),
169
- /*#__PURE__*/ _jsx(Typography, {
170
- variant: "caption",
171
- children: "Matches false boolean"
172
- })
173
- ]
174
- })
175
- })
176
- ]
177
- })
178
- });
179
- }
180
- return null;
181
- }
182
- export function CellEditor({ cell, onChange, onDelete, ...props }) {
7
+ import { renderConditionEditor } from '../models';
8
+ export function ConditionalRule({ cell, onChange, onDelete, ...props }) {
183
9
  return /*#__PURE__*/ _jsxs(Grid, {
184
10
  container: true,
185
11
  spacing: 2,
@@ -267,14 +93,10 @@ export function CellEditor({ cell, onChange, onDelete, ...props }) {
267
93
  })
268
94
  ]
269
95
  }),
270
- /*#__PURE__*/ _jsx(ConditionEditor, {
271
- width: "100%",
272
- condition: cell.condition,
273
- onChange: (updatedCondition)=>onChange({
274
- ...cell,
275
- condition: updatedCondition
276
- })
277
- })
96
+ renderConditionEditor(cell.condition, (updatedCondition)=>onChange({
97
+ ...cell,
98
+ condition: updatedCondition
99
+ }), 'small')
278
100
  ]
279
101
  })
280
102
  }),
@@ -282,14 +104,46 @@ export function CellEditor({ cell, onChange, onDelete, ...props }) {
282
104
  size: {
283
105
  xs: 4
284
106
  },
285
- children: /*#__PURE__*/ _jsx(TextField, {
286
- label: "Display text",
287
- value: cell.text,
288
- onChange: (e)=>onChange({
289
- ...cell,
290
- text: e.target.value
107
+ children: /*#__PURE__*/ _jsxs(Stack, {
108
+ spacing: 1,
109
+ children: [
110
+ /*#__PURE__*/ _jsx(TextField, {
111
+ label: "Display text",
112
+ value: cell.text,
113
+ onChange: (e)=>onChange({
114
+ ...cell,
115
+ text: e.target.value
116
+ }),
117
+ fullWidth: true,
118
+ size: "small"
291
119
  }),
292
- fullWidth: true
120
+ /*#__PURE__*/ _jsxs(Stack, {
121
+ direction: "row",
122
+ spacing: 1,
123
+ children: [
124
+ /*#__PURE__*/ _jsx(TextField, {
125
+ label: "Prefix",
126
+ placeholder: "$",
127
+ value: cell.prefix ?? '',
128
+ onChange: (e)=>onChange({
129
+ ...cell,
130
+ prefix: e.target.value
131
+ }),
132
+ size: "small"
133
+ }),
134
+ /*#__PURE__*/ _jsx(TextField, {
135
+ label: "Suffix",
136
+ placeholder: "%",
137
+ value: cell.suffix ?? '',
138
+ onChange: (e)=>onChange({
139
+ ...cell,
140
+ suffix: e.target.value
141
+ }),
142
+ size: "small"
143
+ })
144
+ ]
145
+ })
146
+ ]
293
147
  })
294
148
  }),
295
149
  /*#__PURE__*/ _jsx(Grid, {
@@ -316,7 +170,7 @@ export function CellEditor({ cell, onChange, onDelete, ...props }) {
316
170
  ...cell,
317
171
  textColor: '#000'
318
172
  }),
319
- children: /*#__PURE__*/ _jsx(PlusIcon, {})
173
+ children: /*#__PURE__*/ _jsx(AddIcon, {})
320
174
  })
321
175
  })
322
176
  }),
@@ -343,7 +197,7 @@ export function CellEditor({ cell, onChange, onDelete, ...props }) {
343
197
  ...cell,
344
198
  backgroundColor: '#000'
345
199
  }),
346
- children: /*#__PURE__*/ _jsx(PlusIcon, {})
200
+ children: /*#__PURE__*/ _jsx(AddIcon, {})
347
201
  })
348
202
  })
349
203
  }),
@@ -368,5 +222,113 @@ export function CellEditor({ cell, onChange, onDelete, ...props }) {
368
222
  ]
369
223
  });
370
224
  }
225
+ export function ConditionalPanel({ cellSettings = [], onChange, addButtonText = 'Add Conditional Format' }) {
226
+ const handleCellChange = (index, updatedCell)=>{
227
+ const updatedCells = [
228
+ ...cellSettings
229
+ ];
230
+ updatedCells[index] = updatedCell;
231
+ onChange(updatedCells);
232
+ };
233
+ const handleCellDelete = (index)=>{
234
+ const updatedCells = [
235
+ ...cellSettings
236
+ ];
237
+ updatedCells.splice(index, 1);
238
+ onChange(updatedCells.length > 0 ? updatedCells : undefined);
239
+ };
240
+ const handleAddCell = ()=>{
241
+ const updatedCells = [
242
+ ...cellSettings
243
+ ];
244
+ updatedCells.push({
245
+ condition: {
246
+ kind: 'Value',
247
+ spec: {
248
+ value: ''
249
+ }
250
+ }
251
+ });
252
+ onChange(updatedCells);
253
+ };
254
+ return /*#__PURE__*/ _jsxs(Stack, {
255
+ spacing: 3,
256
+ sx: {
257
+ mt: 2
258
+ },
259
+ children: [
260
+ /*#__PURE__*/ _jsxs(Grid, {
261
+ container: true,
262
+ spacing: 3,
263
+ children: [
264
+ /*#__PURE__*/ _jsx(Grid, {
265
+ size: {
266
+ xs: 5
267
+ },
268
+ children: /*#__PURE__*/ _jsx(Typography, {
269
+ variant: "subtitle1",
270
+ children: "Condition"
271
+ })
272
+ }),
273
+ /*#__PURE__*/ _jsx(Grid, {
274
+ size: {
275
+ xs: 4
276
+ },
277
+ children: /*#__PURE__*/ _jsx(Typography, {
278
+ variant: "subtitle1",
279
+ children: "Display Text"
280
+ })
281
+ }),
282
+ /*#__PURE__*/ _jsx(Grid, {
283
+ size: {
284
+ xs: 1
285
+ },
286
+ textAlign: "center",
287
+ children: /*#__PURE__*/ _jsx(Typography, {
288
+ variant: "subtitle1",
289
+ children: "Color"
290
+ })
291
+ }),
292
+ /*#__PURE__*/ _jsx(Grid, {
293
+ size: {
294
+ xs: 1
295
+ },
296
+ textAlign: "center",
297
+ children: /*#__PURE__*/ _jsx(Typography, {
298
+ variant: "subtitle1",
299
+ children: "Background"
300
+ })
301
+ }),
302
+ /*#__PURE__*/ _jsx(Grid, {
303
+ size: {
304
+ xs: 1
305
+ }
306
+ })
307
+ ]
308
+ }),
309
+ /*#__PURE__*/ _jsx(Stack, {
310
+ gap: 1.5,
311
+ divider: /*#__PURE__*/ _jsx(Divider, {
312
+ flexItem: true,
313
+ orientation: "horizontal"
314
+ }),
315
+ children: cellSettings.map((cell, i)=>/*#__PURE__*/ _jsx(ConditionalRule, {
316
+ cell: cell,
317
+ onChange: (updatedCell)=>handleCellChange(i, updatedCell),
318
+ onDelete: ()=>handleCellDelete(i)
319
+ }, i))
320
+ }),
321
+ /*#__PURE__*/ _jsx(Button, {
322
+ variant: "outlined",
323
+ startIcon: /*#__PURE__*/ _jsx(AddIcon, {}),
324
+ sx: {
325
+ marginTop: 1
326
+ },
327
+ onClick: handleAddCell,
328
+ children: addButtonText
329
+ })
330
+ ]
331
+ });
332
+ }
371
333
 
372
- //# sourceMappingURL=CellEditor.js.map
334
+ //# sourceMappingURL=ConditionalPanel.js.map
@@ -0,0 +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,WAAW;wCAAEC,MAAMC,EAAEC,MAAM,CAACJ,KAAK;oCAAC;gCAAE;4BACzEK,QAAQ;4BACRC,IAAI;gCAAET,OAAO;4BAAQ;;8CAErB,KAACtB;oCAASyB,OAAM;8CACd,cAAA,MAAC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AY;;;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"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmbeddedPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmbeddedPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAK9D,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,2CAS7E"}
@@ -0,0 +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,6 +1,6 @@
1
1
  import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
2
  import { ReactElement } from 'react';
3
- import { TableOptions } from './table-model';
3
+ import { TableOptions } from '../models';
4
4
  export type TableCellsEditorProps = OptionsEditorProps<TableOptions>;
5
5
  export declare function TableCellsEditor({ onChange, value }: TableCellsEditorProps): ReactElement;
6
6
  //# sourceMappingURL=TableCellsEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableCellsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/TableCellsEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAgB,YAAY,EAAE,MAAM,WAAW,CAAC;AAGvD,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;AAErE,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,qBAAqB,GAAG,YAAY,CAMzF"}
@@ -0,0 +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,6 +1,6 @@
1
1
  import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
2
  import { ReactElement } from 'react';
3
- import { TableOptions } from './table-model';
3
+ import { TableOptions } from '../models';
4
4
  export type TableColumnsEditorProps = OptionsEditorProps<TableOptions>;
5
5
  export declare function TableColumnsEditor({ onChange, value }: TableColumnsEditorProps): ReactElement;
6
6
  //# sourceMappingURL=TableColumnsEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableColumnsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/TableColumnsEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAkB,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzD,MAAM,MAAM,uBAAuB,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;AAEvE,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,uBAAuB,GAAG,YAAY,CAM7F"}
@@ -0,0 +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,7 +1,7 @@
1
1
  import { PanelProps } from '@perses-dev/plugin-system';
2
2
  import { ReactElement } from 'react';
3
3
  import { TimeSeriesData } from '@perses-dev/core';
4
- import { TableOptions } from './table-model';
4
+ import { TableOptions } from '../models';
5
5
  export declare function getTablePanelQueryOptions(spec: TableOptions): {
6
6
  mode: 'instant' | 'range';
7
7
  };
@@ -0,0 +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;AAqKxF,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,CAgXrG"}