@perses-dev/table-plugin 0.9.0 → 0.10.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 (164) hide show
  1. package/__mf/css/async/2341.d3010b86.css +1 -0
  2. package/__mf/css/async/5263.d3010b86.css +1 -0
  3. package/__mf/css/async/6759.d3010b86.css +1 -0
  4. package/__mf/js/{Table.09045c91.js → Table.02a0172e.js} +4 -4
  5. package/__mf/js/async/2178.23b43aaf.js +1 -0
  6. package/__mf/js/async/2472.d6b3b5c6.js +22 -0
  7. package/__mf/js/async/2849.0d68beb5.js +2 -0
  8. package/__mf/js/async/{4075.e2a2c230.js → 4075.98f26cf8.js} +1 -1
  9. package/__mf/js/async/{4238.ea9515aa.js → 4238.8989501f.js} +1 -1
  10. package/__mf/js/async/6377.1f2ba730.js +38 -0
  11. package/__mf/js/async/9830.a2983642.js +7 -0
  12. package/__mf/js/async/__federation_expose_Table.0dbf0d6d.js +1 -0
  13. package/__mf/js/{main.0cb08842.js → main.f7b12b00.js} +4 -4
  14. package/lib/Table.d.ts +2 -2
  15. package/lib/Table.d.ts.map +1 -1
  16. package/lib/Table.js +2 -6
  17. package/lib/Table.js.map +1 -1
  18. package/lib/cjs/Table.js +9 -13
  19. package/lib/cjs/components/CellsEditor/CellsEditor.js +30 -0
  20. package/lib/cjs/{CellsEditor → components/CellsEditor}/index.js +0 -1
  21. package/lib/cjs/components/ColumnsEditor/ColumnEditor.js +241 -0
  22. package/lib/cjs/{CellsEditor/CellEditor.js → components/ConditionalPanel.js} +167 -197
  23. package/lib/cjs/components/TablePanel.js +576 -0
  24. package/lib/cjs/{TableSettingsEditor.js → components/TableSettingsEditor.js} +32 -4
  25. package/lib/cjs/components/index.js +37 -0
  26. package/lib/cjs/index.js +2 -9
  27. package/lib/cjs/models/index.js +31 -0
  28. package/lib/cjs/{table-model.js → models/model.js} +1 -12
  29. package/lib/cjs/models/table-model.js +252 -0
  30. package/lib/{CellsEditor → components/CellsEditor}/CellsEditor.d.ts +1 -1
  31. package/lib/components/CellsEditor/CellsEditor.d.ts.map +1 -0
  32. package/lib/components/CellsEditor/CellsEditor.js +22 -0
  33. package/lib/components/CellsEditor/CellsEditor.js.map +1 -0
  34. package/lib/components/CellsEditor/index.d.ts +2 -0
  35. package/lib/components/CellsEditor/index.d.ts.map +1 -0
  36. package/lib/{CellsEditor → components/CellsEditor}/index.js +0 -1
  37. package/lib/components/CellsEditor/index.js.map +1 -0
  38. package/lib/{ColumnsEditor → components/ColumnsEditor}/ColumnEditor.d.ts +1 -1
  39. package/lib/components/ColumnsEditor/ColumnEditor.d.ts.map +1 -0
  40. package/lib/components/ColumnsEditor/ColumnEditor.js +233 -0
  41. package/lib/components/ColumnsEditor/ColumnEditor.js.map +1 -0
  42. package/lib/components/ColumnsEditor/ColumnEditorContainer.d.ts.map +1 -0
  43. package/lib/components/ColumnsEditor/ColumnEditorContainer.js.map +1 -0
  44. package/lib/{ColumnsEditor → components/ColumnsEditor}/ColumnsEditor.d.ts +1 -1
  45. package/lib/components/ColumnsEditor/ColumnsEditor.d.ts.map +1 -0
  46. package/lib/components/ColumnsEditor/ColumnsEditor.js.map +1 -0
  47. package/lib/components/ColumnsEditor/index.d.ts.map +1 -0
  48. package/lib/components/ColumnsEditor/index.js.map +1 -0
  49. package/lib/components/ConditionalPanel.d.ts +15 -0
  50. package/lib/components/ConditionalPanel.d.ts.map +1 -0
  51. package/lib/{CellsEditor/CellEditor.js → components/ConditionalPanel.js} +159 -197
  52. package/lib/components/ConditionalPanel.js.map +1 -0
  53. package/lib/components/EmbeddedPanel.d.ts.map +1 -0
  54. package/lib/components/EmbeddedPanel.js.map +1 -0
  55. package/lib/{TableCellsEditor.d.ts → components/TableCellsEditor.d.ts} +1 -1
  56. package/lib/components/TableCellsEditor.d.ts.map +1 -0
  57. package/lib/components/TableCellsEditor.js.map +1 -0
  58. package/lib/{TableColumnsEditor.d.ts → components/TableColumnsEditor.d.ts} +1 -1
  59. package/lib/components/TableColumnsEditor.d.ts.map +1 -0
  60. package/lib/components/TableColumnsEditor.js.map +1 -0
  61. package/lib/{TablePanel.d.ts → components/TablePanel.d.ts} +1 -1
  62. package/lib/components/TablePanel.d.ts.map +1 -0
  63. package/lib/components/TablePanel.js +560 -0
  64. package/lib/components/TablePanel.js.map +1 -0
  65. package/lib/{TableSettingsEditor.d.ts → components/TableSettingsEditor.d.ts} +1 -1
  66. package/lib/components/TableSettingsEditor.d.ts.map +1 -0
  67. package/lib/{TableSettingsEditor.js → components/TableSettingsEditor.js} +32 -4
  68. package/lib/components/TableSettingsEditor.js.map +1 -0
  69. package/lib/{TableTransformsEditor.d.ts → components/TableTransformsEditor.d.ts} +1 -1
  70. package/lib/components/TableTransformsEditor.d.ts.map +1 -0
  71. package/lib/components/TableTransformsEditor.js.map +1 -0
  72. package/lib/components/index.d.ts +9 -0
  73. package/lib/components/index.d.ts.map +1 -0
  74. package/lib/components/index.js +22 -0
  75. package/lib/components/index.js.map +1 -0
  76. package/lib/index.d.ts +2 -9
  77. package/lib/index.d.ts.map +1 -1
  78. package/lib/index.js +2 -9
  79. package/lib/index.js.map +1 -1
  80. package/lib/models/index.d.ts +3 -0
  81. package/lib/models/index.d.ts.map +1 -0
  82. package/lib/{table-model.js → models/index.js} +4 -9
  83. package/lib/models/index.js.map +1 -0
  84. package/lib/models/model.d.ts.map +1 -0
  85. package/lib/models/model.js +15 -0
  86. package/lib/models/model.js.map +1 -0
  87. package/lib/{table-model.d.ts → models/table-model.d.ts} +24 -1
  88. package/lib/models/table-model.d.ts.map +1 -0
  89. package/lib/models/table-model.js +233 -0
  90. package/lib/models/table-model.js.map +1 -0
  91. package/mf-manifest.json +20 -21
  92. package/mf-stats.json +21 -22
  93. package/package.json +5 -5
  94. package/__mf/css/async/2341.cbbd94a8.css +0 -1
  95. package/__mf/css/async/5263.cbbd94a8.css +0 -1
  96. package/__mf/css/async/6759.cbbd94a8.css +0 -1
  97. package/__mf/js/async/3391.62c7afd4.js +0 -73
  98. package/__mf/js/async/4300.fc319dfb.js +0 -38
  99. package/__mf/js/async/4368.3e460b07.js +0 -1
  100. package/__mf/js/async/5061.85655462.js +0 -2
  101. package/__mf/js/async/5377.6522c49a.js +0 -1
  102. package/__mf/js/async/8313.b86a056a.js +0 -7
  103. package/__mf/js/async/__federation_expose_Table.3668e352.js +0 -1
  104. package/lib/CellsEditor/CellEditor.d.ts +0 -10
  105. package/lib/CellsEditor/CellEditor.d.ts.map +0 -1
  106. package/lib/CellsEditor/CellEditor.js.map +0 -1
  107. package/lib/CellsEditor/CellsEditor.d.ts.map +0 -1
  108. package/lib/CellsEditor/CellsEditor.js +0 -123
  109. package/lib/CellsEditor/CellsEditor.js.map +0 -1
  110. package/lib/CellsEditor/index.d.ts +0 -3
  111. package/lib/CellsEditor/index.d.ts.map +0 -1
  112. package/lib/CellsEditor/index.js.map +0 -1
  113. package/lib/ColumnsEditor/ColumnEditor.d.ts.map +0 -1
  114. package/lib/ColumnsEditor/ColumnEditor.js +0 -213
  115. package/lib/ColumnsEditor/ColumnEditor.js.map +0 -1
  116. package/lib/ColumnsEditor/ColumnEditorContainer.d.ts.map +0 -1
  117. package/lib/ColumnsEditor/ColumnEditorContainer.js.map +0 -1
  118. package/lib/ColumnsEditor/ColumnsEditor.d.ts.map +0 -1
  119. package/lib/ColumnsEditor/ColumnsEditor.js.map +0 -1
  120. package/lib/ColumnsEditor/index.d.ts.map +0 -1
  121. package/lib/ColumnsEditor/index.js.map +0 -1
  122. package/lib/EmbeddedPanel.d.ts.map +0 -1
  123. package/lib/EmbeddedPanel.js.map +0 -1
  124. package/lib/TableCellsEditor.d.ts.map +0 -1
  125. package/lib/TableCellsEditor.js.map +0 -1
  126. package/lib/TableColumnsEditor.d.ts.map +0 -1
  127. package/lib/TableColumnsEditor.js.map +0 -1
  128. package/lib/TablePanel.d.ts.map +0 -1
  129. package/lib/TablePanel.js +0 -325
  130. package/lib/TablePanel.js.map +0 -1
  131. package/lib/TableSettingsEditor.d.ts.map +0 -1
  132. package/lib/TableSettingsEditor.js.map +0 -1
  133. package/lib/TableTransformsEditor.d.ts.map +0 -1
  134. package/lib/TableTransformsEditor.js.map +0 -1
  135. package/lib/cjs/CellsEditor/CellsEditor.js +0 -136
  136. package/lib/cjs/ColumnsEditor/ColumnEditor.js +0 -221
  137. package/lib/cjs/TablePanel.js +0 -341
  138. package/lib/cjs/model.js +0 -4
  139. package/lib/model.d.ts.map +0 -1
  140. package/lib/model.js +0 -3
  141. package/lib/model.js.map +0 -1
  142. package/lib/table-model.d.ts.map +0 -1
  143. package/lib/table-model.js.map +0 -1
  144. /package/__mf/js/async/{3391.62c7afd4.js.LICENSE.txt → 2472.d6b3b5c6.js.LICENSE.txt} +0 -0
  145. /package/__mf/js/async/{5061.85655462.js.LICENSE.txt → 2849.0d68beb5.js.LICENSE.txt} +0 -0
  146. /package/__mf/js/async/{8313.b86a056a.js.LICENSE.txt → 9830.a2983642.js.LICENSE.txt} +0 -0
  147. /package/lib/cjs/{ColumnsEditor → components/ColumnsEditor}/ColumnEditorContainer.js +0 -0
  148. /package/lib/cjs/{ColumnsEditor → components/ColumnsEditor}/ColumnsEditor.js +0 -0
  149. /package/lib/cjs/{ColumnsEditor → components/ColumnsEditor}/index.js +0 -0
  150. /package/lib/cjs/{EmbeddedPanel.js → components/EmbeddedPanel.js} +0 -0
  151. /package/lib/cjs/{TableCellsEditor.js → components/TableCellsEditor.js} +0 -0
  152. /package/lib/cjs/{TableColumnsEditor.js → components/TableColumnsEditor.js} +0 -0
  153. /package/lib/cjs/{TableTransformsEditor.js → components/TableTransformsEditor.js} +0 -0
  154. /package/lib/{ColumnsEditor → components/ColumnsEditor}/ColumnEditorContainer.d.ts +0 -0
  155. /package/lib/{ColumnsEditor → components/ColumnsEditor}/ColumnEditorContainer.js +0 -0
  156. /package/lib/{ColumnsEditor → components/ColumnsEditor}/ColumnsEditor.js +0 -0
  157. /package/lib/{ColumnsEditor → components/ColumnsEditor}/index.d.ts +0 -0
  158. /package/lib/{ColumnsEditor → components/ColumnsEditor}/index.js +0 -0
  159. /package/lib/{EmbeddedPanel.d.ts → components/EmbeddedPanel.d.ts} +0 -0
  160. /package/lib/{EmbeddedPanel.js → components/EmbeddedPanel.js} +0 -0
  161. /package/lib/{TableCellsEditor.js → components/TableCellsEditor.js} +0 -0
  162. /package/lib/{TableColumnsEditor.js → components/TableColumnsEditor.js} +0 -0
  163. /package/lib/{TableTransformsEditor.js → components/TableTransformsEditor.js} +0 -0
  164. /package/lib/{model.d.ts → models/model.d.ts} +0 -0
@@ -34,10 +34,12 @@ function DefaultColumnsDimensionsControl({ label, defaultValue, value, onChange
34
34
  control: /*#__PURE__*/ _jsx(TextField, {
35
35
  type: "number",
36
36
  value: value ?? defaultValue,
37
- InputProps: {
38
- inputProps: {
39
- min: 1,
40
- step: 1
37
+ slotProps: {
38
+ input: {
39
+ inputProps: {
40
+ min: 1,
41
+ step: 1
42
+ }
41
43
  }
42
44
  },
43
45
  onChange: (e)=>onChange(parseInt(e.target.value))
@@ -59,6 +61,12 @@ export function TableSettingsEditor({ onChange, value }) {
59
61
  pagination: newValue
60
62
  });
61
63
  }
64
+ function handleDefaultColumnHiddenChange(_event, newValue) {
65
+ onChange({
66
+ ...value,
67
+ defaultColumnHidden: newValue
68
+ });
69
+ }
62
70
  function handleAutoWidthChange(newValue) {
63
71
  onChange({
64
72
  ...value,
@@ -71,6 +79,12 @@ export function TableSettingsEditor({ onChange, value }) {
71
79
  defaultColumnHeight: newValue
72
80
  });
73
81
  }
82
+ function handleEnableFilteringChange(_event, checked) {
83
+ onChange({
84
+ ...value,
85
+ enableFiltering: checked
86
+ });
87
+ }
74
88
  return /*#__PURE__*/ _jsx(OptionsEditorGrid, {
75
89
  children: /*#__PURE__*/ _jsx(OptionsEditorColumn, {
76
90
  children: /*#__PURE__*/ _jsxs(OptionsEditorGroup, {
@@ -87,6 +101,20 @@ export function TableSettingsEditor({ onChange, value }) {
87
101
  onChange: handlePaginationChange
88
102
  })
89
103
  }),
104
+ /*#__PURE__*/ _jsx(OptionsEditorControl, {
105
+ label: "Columns Hidden by Default",
106
+ control: /*#__PURE__*/ _jsx(Switch, {
107
+ checked: !!value.defaultColumnHidden,
108
+ onChange: handleDefaultColumnHiddenChange
109
+ })
110
+ }),
111
+ /*#__PURE__*/ _jsx(OptionsEditorControl, {
112
+ label: "Enable Column Filtering",
113
+ control: /*#__PURE__*/ _jsx(Switch, {
114
+ checked: !!value.enableFiltering,
115
+ onChange: handleEnableFilteringChange
116
+ })
117
+ }),
90
118
  /*#__PURE__*/ _jsx(DefaultColumnsDimensionsControl, {
91
119
  label: "Width",
92
120
  defaultValue: DEFAULT_COLUMN_WIDTH,
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/TableSettingsEditor.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 { Switch, TextField } from '@mui/material';\nimport {\n DEFAULT_COLUMN_HEIGHT,\n DEFAULT_COLUMN_WIDTH,\n DensitySelector,\n OptionsEditorColumn,\n OptionsEditorControl,\n OptionsEditorGrid,\n OptionsEditorGroup,\n TableDensity,\n} from '@perses-dev/components';\nimport { ChangeEvent, ReactElement } from 'react';\nimport { TableSettingsEditorProps } from '../models';\n\ninterface DefaultColumnsDimensionsControlProps {\n label: string;\n defaultValue: number;\n value?: 'auto' | number;\n onChange: (value: 'auto' | number) => void;\n}\n\nfunction DefaultColumnsDimensionsControl({\n label,\n defaultValue,\n value,\n onChange,\n}: DefaultColumnsDimensionsControlProps): ReactElement {\n function handleAutoSwitchChange(_: ChangeEvent, checked: boolean): void {\n if (checked) {\n return onChange('auto');\n }\n onChange(defaultValue);\n }\n\n return (\n <>\n <OptionsEditorControl\n label={`Auto Columns ${label}`}\n control={<Switch checked={value === undefined || value === 'auto'} onChange={handleAutoSwitchChange} />}\n />\n {value !== undefined && value !== 'auto' && (\n <OptionsEditorControl\n label={`Default Columns ${label}`}\n control={\n <TextField\n type=\"number\"\n value={value ?? defaultValue}\n slotProps={{ input: { inputProps: { min: 1, step: 1 } } }}\n onChange={(e) => onChange(parseInt(e.target.value))}\n />\n }\n />\n )}\n </>\n );\n}\n\nexport function TableSettingsEditor({ onChange, value }: TableSettingsEditorProps): ReactElement {\n function handleDensityChange(density: TableDensity): void {\n onChange({ ...value, density: density });\n }\n\n function handlePaginationChange(_event: ChangeEvent, newValue: boolean): void {\n onChange({ ...value, pagination: newValue });\n }\n\n function handleDefaultColumnHiddenChange(_event: ChangeEvent, newValue: boolean): void {\n onChange({ ...value, defaultColumnHidden: newValue });\n }\n\n function handleAutoWidthChange(newValue: 'auto' | number): void {\n onChange({ ...value, defaultColumnWidth: newValue });\n }\n\n function handleAutoHeightChange(newValue: 'auto' | number): void {\n onChange({ ...value, defaultColumnHeight: newValue });\n }\n\n function handleEnableFilteringChange(_event: ChangeEvent, checked: boolean): void {\n onChange({ ...value, enableFiltering: checked });\n }\n\n return (\n <OptionsEditorGrid>\n <OptionsEditorColumn>\n <OptionsEditorGroup title=\"Display\">\n <DensitySelector value={value.density} onChange={handleDensityChange} />\n <OptionsEditorControl\n label=\"Pagination\"\n control={<Switch checked={!!value.pagination} onChange={handlePaginationChange} />}\n />\n <OptionsEditorControl\n label=\"Columns Hidden by Default\"\n control={<Switch checked={!!value.defaultColumnHidden} onChange={handleDefaultColumnHiddenChange} />}\n />\n <OptionsEditorControl\n label=\"Enable Column Filtering\"\n control={<Switch checked={!!value.enableFiltering} onChange={handleEnableFilteringChange} />}\n />\n\n <DefaultColumnsDimensionsControl\n label=\"Width\"\n defaultValue={DEFAULT_COLUMN_WIDTH}\n value={value.defaultColumnWidth}\n onChange={handleAutoWidthChange}\n />\n <DefaultColumnsDimensionsControl\n label=\"Height\"\n defaultValue={DEFAULT_COLUMN_HEIGHT}\n value={value.defaultColumnHeight}\n onChange={handleAutoHeightChange}\n />\n </OptionsEditorGroup>\n </OptionsEditorColumn>\n </OptionsEditorGrid>\n );\n}\n"],"names":["Switch","TextField","DEFAULT_COLUMN_HEIGHT","DEFAULT_COLUMN_WIDTH","DensitySelector","OptionsEditorColumn","OptionsEditorControl","OptionsEditorGrid","OptionsEditorGroup","DefaultColumnsDimensionsControl","label","defaultValue","value","onChange","handleAutoSwitchChange","_","checked","control","undefined","type","slotProps","input","inputProps","min","step","e","parseInt","target","TableSettingsEditor","handleDensityChange","density","handlePaginationChange","_event","newValue","pagination","handleDefaultColumnHiddenChange","defaultColumnHidden","handleAutoWidthChange","defaultColumnWidth","handleAutoHeightChange","defaultColumnHeight","handleEnableFilteringChange","enableFiltering","title"],"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,SAASA,MAAM,EAAEC,SAAS,QAAQ,gBAAgB;AAClD,SACEC,qBAAqB,EACrBC,oBAAoB,EACpBC,eAAe,EACfC,mBAAmB,EACnBC,oBAAoB,EACpBC,iBAAiB,EACjBC,kBAAkB,QAEb,yBAAyB;AAWhC,SAASC,gCAAgC,EACvCC,KAAK,EACLC,YAAY,EACZC,KAAK,EACLC,QAAQ,EAC6B;IACrC,SAASC,uBAAuBC,CAAc,EAAEC,OAAgB;QAC9D,IAAIA,SAAS;YACX,OAAOH,SAAS;QAClB;QACAA,SAASF;IACX;IAEA,qBACE;;0BACE,KAACL;gBACCI,OAAO,CAAC,aAAa,EAAEA,OAAO;gBAC9BO,uBAAS,KAACjB;oBAAOgB,SAASJ,UAA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MsB,UAAU;4BAAErB,UAAUkB;;;kCAE1D,KAACzB;wBACCI,OAAM;wBACNO,uBAAS,KAACjB;4BAAOgB,SAAS,CAAC,CAACJ,MAAMwB,mBAAmB;4BAAEvB,UAAUsB;;;kCAEnE,KAAC7B;wBACCI,OAAM;wBACNO,uBAAS,KAACjB;4BAAOgB,SAAS,CAAC,CAACJ,MAAM8B,eAAe;4BAAE7B,UAAU4B;;;kCAG/D,KAAChC;wBACCC,OAAM;wBACNC,cAAcR;wBACdS,OAAOA,MAAM0B,kBAAkB;wBAC/BzB,UAAUwB;;kCAEZ,KAAC5B;wBACCC,OAAM;wBACNC,cAAcT;wBACdU,OAAOA,MAAM4B,mBAAmB;wBAChC3B,UAAU0B;;;;;;AAMtB"}
@@ -1,4 +1,4 @@
1
1
  import { ReactElement } from 'react';
2
- import { TableSettingsEditorProps } from './table-model';
2
+ import { TableSettingsEditorProps } from '../models';
3
3
  export declare function TableTransformsEditor({ value, onChange }: TableSettingsEditorProps): ReactElement;
4
4
  //# sourceMappingURL=TableTransformsEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableTransformsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/TableTransformsEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,wBAAwB,GAAG,YAAY,CAMjG"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/TableTransformsEditor.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 { TransformsEditor } from '@perses-dev/components';\nimport { Transform } from '@perses-dev/core';\nimport { ReactElement } from 'react';\nimport { TableSettingsEditorProps } from '../models';\n\nexport function TableTransformsEditor({ value, onChange }: TableSettingsEditorProps): ReactElement {\n function handleTransformsChange(transforms: Transform[]): void {\n onChange({ ...value, transforms: transforms });\n }\n\n return <TransformsEditor value={value.transforms ?? []} onChange={handleTransformsChange} />;\n}\n"],"names":["TransformsEditor","TableTransformsEditor","value","onChange","handleTransformsChange","transforms"],"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,SAASA,gBAAgB,QAAQ,yBAAyB;AAK1D,OAAO,SAASC,sBAAsB,EAAEC,KAAK,EAAEC,QAAQ,EAA4B;IACjF,SAASC,uBAAuBC,UAAuB;QACrDF,SAAS;YAAE,GAAGD,KAAK;YAAEG,YAAYA;QAAW;IAC9C;IAEA,qBAAO,KAACL;QAAiBE,OAAOA,MAAMG,UAAU,IAAI,EAAE;QAAEF,UAAUC;;AACpE"}
@@ -0,0 +1,9 @@
1
+ export * from './CellsEditor';
2
+ export * from './ColumnsEditor';
3
+ export * from './EmbeddedPanel';
4
+ export * from './TableCellsEditor';
5
+ export * from './TableColumnsEditor';
6
+ export * from './TablePanel';
7
+ export * from './TableSettingsEditor';
8
+ export * from './TableTransformsEditor';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,22 @@
1
+ // Copyright 2025 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
+ export * from './CellsEditor';
14
+ export * from './ColumnsEditor';
15
+ export * from './EmbeddedPanel';
16
+ export * from './TableCellsEditor';
17
+ export * from './TableColumnsEditor';
18
+ export * from './TablePanel';
19
+ export * from './TableSettingsEditor';
20
+ export * from './TableTransformsEditor';
21
+
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/index.ts"],"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\nexport * from './CellsEditor';\nexport * from './ColumnsEditor';\nexport * from './EmbeddedPanel';\nexport * from './TableCellsEditor';\nexport * from './TableColumnsEditor';\nexport * from './TablePanel';\nexport * from './TableSettingsEditor';\nexport * from './TableTransformsEditor';\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,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,eAAe;AAC7B,cAAc,wBAAwB;AACtC,cAAc,0BAA0B"}
package/lib/index.d.ts CHANGED
@@ -1,12 +1,5 @@
1
1
  export { getPluginModule } from './getPluginModule';
2
- export * from './CellsEditor';
3
- export * from './ColumnsEditor';
4
2
  export * from './Table';
5
- export * from './TableCellsEditor';
6
- export * from './TableColumnsEditor';
7
- export * from './TablePanel';
8
- export * from './TableSettingsEditor';
9
- export * from './TableTransformsEditor';
10
- export * from './model';
11
- export * from './table-model';
3
+ export * from './components';
4
+ export * from './models';
12
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
package/lib/index.js CHANGED
@@ -1,13 +1,6 @@
1
1
  export { getPluginModule } from './getPluginModule';
2
- export * from './CellsEditor';
3
- export * from './ColumnsEditor';
4
2
  export * from './Table';
5
- export * from './TableCellsEditor';
6
- export * from './TableColumnsEditor';
7
- export * from './TablePanel';
8
- export * from './TableSettingsEditor';
9
- export * from './TableTransformsEditor';
10
- export * from './model';
11
- export * from './table-model';
3
+ export * from './components';
4
+ export * from './models';
12
5
 
13
6
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getPluginModule } from './getPluginModule';\nexport * from './CellsEditor';\nexport * from './ColumnsEditor';\nexport * from './Table';\nexport * from './TableCellsEditor';\nexport * from './TableColumnsEditor';\nexport * from './TablePanel';\nexport * from './TableSettingsEditor';\nexport * from './TableTransformsEditor';\nexport * from './model';\nexport * from './table-model';\n"],"names":["getPluginModule"],"mappings":"AAAA,SAASA,eAAe,QAAQ,oBAAoB;AACpD,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,UAAU;AACxB,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,eAAe;AAC7B,cAAc,wBAAwB;AACtC,cAAc,0BAA0B;AACxC,cAAc,UAAU;AACxB,cAAc,gBAAgB"}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { getPluginModule } from './getPluginModule';\nexport * from './Table';\nexport * from './components';\nexport * from './models';\n"],"names":["getPluginModule"],"mappings":"AAAA,SAASA,eAAe,QAAQ,oBAAoB;AACpD,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,WAAW"}
@@ -0,0 +1,3 @@
1
+ export * from './model';
2
+ export * from './table-model';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAaA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright 2025 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
@@ -10,12 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- /**
14
- * Creates the initial/empty options for a Table panel.
15
- */ export function createInitialTableOptions() {
16
- return {
17
- density: 'standard'
18
- };
19
- }
13
+ export * from './model';
14
+ export * from './table-model';
20
15
 
21
- //# sourceMappingURL=table-model.js.map
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/models/index.ts"],"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\nexport * from './model';\nexport * from './table-model';\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,UAAU;AACxB,cAAc,gBAAgB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/models/model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,UAAU,sBAAsB;CAAG;AAEnC,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ // Copyright 2025 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
+ export { };
14
+
15
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/models/model.ts"],"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 { PanelProps } from '@perses-dev/plugin-system';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\ninterface TimeSeriesTableOptions {}\n\nexport type TimeSeriesTableProps = PanelProps<TimeSeriesTableOptions>;\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;AAOjC,WAAsE"}
@@ -1,6 +1,7 @@
1
1
  import { Definition, FormatOptions, Transform, UnknownSpec } from '@perses-dev/core';
2
- import { TableDensity } from '@perses-dev/components';
2
+ import { TableDensity, TableCellConfig } from '@perses-dev/components';
3
3
  import { OptionsEditorProps } from '@perses-dev/plugin-system';
4
+ import React from 'react';
4
5
  export interface ColumnSettings {
5
6
  name: string;
6
7
  header?: string;
@@ -33,6 +34,7 @@ export interface ColumnSettings {
33
34
  */
34
35
  width?: number | 'auto';
35
36
  hide?: boolean;
37
+ cellSettings?: CellSettings[];
36
38
  }
37
39
  export interface ValueCondition {
38
40
  kind: 'Value';
@@ -63,6 +65,8 @@ export type Condition = ValueCondition | RangeCondition | RegexCondition | MiscC
63
65
  export interface CellSettings {
64
66
  condition: Condition;
65
67
  text?: string;
68
+ prefix?: string;
69
+ suffix?: string;
66
70
  textColor?: `#${string}`;
67
71
  backgroundColor?: `#${string}`;
68
72
  }
@@ -79,7 +83,9 @@ export interface TableOptions {
79
83
  density?: TableDensity;
80
84
  defaultColumnWidth?: 'auto' | number;
81
85
  defaultColumnHeight?: 'auto' | number;
86
+ defaultColumnHidden?: boolean;
82
87
  pagination?: boolean;
88
+ enableFiltering?: boolean;
83
89
  columnSettings?: ColumnSettings[];
84
90
  cellSettings?: CellSettings[];
85
91
  transforms?: Transform[];
@@ -89,4 +95,21 @@ export interface TableOptions {
89
95
  */
90
96
  export declare function createInitialTableOptions(): TableOptions;
91
97
  export type TableSettingsEditorProps = OptionsEditorProps<TableOptions>;
98
+ /**
99
+ * Formats the display text and colors based on cell settings
100
+ */
101
+ export declare function formatCellDisplay(value: unknown, setting: CellSettings, defaultText?: string): TableCellConfig;
102
+ /**
103
+ * Evaluates if a condition matches the given value
104
+ */
105
+ export declare function evaluateCondition(condition: Condition, value: unknown): boolean;
106
+ /**
107
+ * Evaluates all conditions and returns the cell config for the first matching condition
108
+ */
109
+ export declare function evaluateConditionalFormatting(value: unknown, settings: CellSettings[]): TableCellConfig | undefined;
110
+ /**
111
+ * Renders the condition editor component for a given condition
112
+ * This function can be used by both CellEditor and ColumnEditor to maintain consistency
113
+ */
114
+ export declare function renderConditionEditor(condition: Condition, onChange: (condition: Condition) => void, size?: 'small' | 'medium'): React.ReactElement | null;
92
115
  //# sourceMappingURL=table-model.d.ts.map
@@ -0,0 +1 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AY,CAAC,CAAC;AAExE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,eAAe,CAQ9G;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAuD/E;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,eAAe,GAAG,SAAS,CAqBnH;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,EACxC,IAAI,GAAE,OAAO,GAAG,QAAkB,GACjC,KAAK,CAAC,YAAY,GAAG,IAAI,CA8F3B"}
@@ -0,0 +1,233 @@
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
+ import React from 'react';
14
+ import { TextField, Stack, MenuItem, Typography } from '@mui/material';
15
+ /**
16
+ * Creates the initial/empty options for a Table panel.
17
+ */ export function createInitialTableOptions() {
18
+ return {
19
+ density: 'standard',
20
+ enableFiltering: true
21
+ };
22
+ }
23
+ /**
24
+ * Formats the display text and colors based on cell settings
25
+ */ export function formatCellDisplay(value, setting, defaultText) {
26
+ const baseText = setting.text || defaultText || String(value);
27
+ const displayText = `${setting.prefix ?? ''}${baseText}${setting.suffix ?? ''}`;
28
+ return {
29
+ text: displayText,
30
+ textColor: setting.textColor,
31
+ backgroundColor: setting.backgroundColor
32
+ };
33
+ }
34
+ /**
35
+ * Evaluates if a condition matches the given value
36
+ */ export function evaluateCondition(condition, value) {
37
+ switch(condition.kind){
38
+ case 'Value':
39
+ return condition.spec?.value === String(value);
40
+ case 'Range':
41
+ {
42
+ if (Number.isNaN(Number(value))) return false;
43
+ const numericValue = Number(value);
44
+ // Both min and max defined
45
+ if (condition.spec?.min !== undefined && condition.spec?.max !== undefined) {
46
+ return numericValue >= +condition.spec.min && numericValue <= +condition.spec.max;
47
+ }
48
+ // Only min defined
49
+ if (condition.spec?.min !== undefined) {
50
+ return numericValue >= +condition.spec.min;
51
+ }
52
+ // Only max defined
53
+ if (condition.spec?.max !== undefined) {
54
+ return numericValue <= +condition.spec.max;
55
+ }
56
+ return false;
57
+ }
58
+ case 'Regex':
59
+ if (!condition.spec?.expr) return false;
60
+ try {
61
+ const regex = new RegExp(condition.spec.expr);
62
+ return regex.test(String(value));
63
+ } catch {
64
+ return false; // Invalid regex
65
+ }
66
+ case 'Misc':
67
+ switch(condition.spec?.value){
68
+ case 'empty':
69
+ return value === '';
70
+ case 'null':
71
+ return value === null || value === undefined;
72
+ case 'NaN':
73
+ return Number.isNaN(value);
74
+ case 'true':
75
+ return value === true;
76
+ case 'false':
77
+ return value === false;
78
+ default:
79
+ return false;
80
+ }
81
+ default:
82
+ return false;
83
+ }
84
+ }
85
+ /**
86
+ * Evaluates all conditions and returns the cell config for the first matching condition
87
+ */ export function evaluateConditionalFormatting(value, settings) {
88
+ for (const setting of settings){
89
+ if (evaluateCondition(setting.condition, value)) {
90
+ // Handle special default text cases
91
+ let defaultText;
92
+ if (setting.condition.kind === 'Misc') {
93
+ switch(setting.condition.spec?.value){
94
+ case 'null':
95
+ defaultText = 'null';
96
+ break;
97
+ case 'NaN':
98
+ defaultText = 'NaN';
99
+ break;
100
+ }
101
+ }
102
+ return formatCellDisplay(value, setting, defaultText);
103
+ }
104
+ }
105
+ return undefined; // No conditions matched
106
+ }
107
+ /**
108
+ * Renders the condition editor component for a given condition
109
+ * This function can be used by both CellEditor and ColumnEditor to maintain consistency
110
+ */ export function renderConditionEditor(condition, onChange, size = 'small') {
111
+ if (condition.kind === 'Value') {
112
+ return React.createElement(TextField, {
113
+ label: 'Value',
114
+ placeholder: 'Exact value',
115
+ value: condition.spec?.value ?? '',
116
+ onChange: (e)=>onChange({
117
+ ...condition,
118
+ spec: {
119
+ value: e.target.value
120
+ }
121
+ }),
122
+ fullWidth: true,
123
+ size: size
124
+ });
125
+ } else if (condition.kind === 'Range') {
126
+ return React.createElement(Stack, {
127
+ gap: 1,
128
+ direction: 'row'
129
+ }, [
130
+ React.createElement(TextField, {
131
+ key: 'min',
132
+ label: 'From',
133
+ placeholder: 'Start of range',
134
+ value: condition.spec?.min ?? '',
135
+ onChange: (e)=>onChange({
136
+ ...condition,
137
+ spec: {
138
+ ...condition.spec,
139
+ min: +e.target.value
140
+ }
141
+ }),
142
+ fullWidth: true,
143
+ size: size
144
+ }),
145
+ React.createElement(TextField, {
146
+ key: 'max',
147
+ label: 'To',
148
+ placeholder: 'End of range (inclusive)',
149
+ value: condition.spec?.max ?? '',
150
+ onChange: (e)=>onChange({
151
+ ...condition,
152
+ spec: {
153
+ ...condition.spec,
154
+ max: +e.target.value
155
+ }
156
+ }),
157
+ fullWidth: true,
158
+ size: size
159
+ })
160
+ ]);
161
+ } else if (condition.kind === 'Regex') {
162
+ return React.createElement(TextField, {
163
+ label: 'Regular Expression',
164
+ placeholder: 'JavaScript regular expression',
165
+ value: condition.spec?.expr ?? '',
166
+ onChange: (e)=>onChange({
167
+ ...condition,
168
+ spec: {
169
+ expr: e.target.value
170
+ }
171
+ }),
172
+ fullWidth: true,
173
+ size: size
174
+ });
175
+ } else if (condition.kind === 'Misc') {
176
+ const options = [
177
+ {
178
+ value: 'empty',
179
+ label: 'Empty',
180
+ caption: 'Matches empty string'
181
+ },
182
+ {
183
+ value: 'null',
184
+ label: 'Null',
185
+ caption: 'Matches null or undefined'
186
+ },
187
+ {
188
+ value: 'NaN',
189
+ label: 'NaN',
190
+ caption: 'Matches Not a Number value'
191
+ },
192
+ {
193
+ value: 'true',
194
+ label: 'True',
195
+ caption: 'Matches true boolean'
196
+ },
197
+ {
198
+ value: 'false',
199
+ label: 'False',
200
+ caption: 'Matches false boolean'
201
+ }
202
+ ];
203
+ return React.createElement(TextField, {
204
+ select: true,
205
+ label: 'Value',
206
+ value: condition.spec?.value ?? '',
207
+ onChange: (e)=>onChange({
208
+ ...condition,
209
+ spec: {
210
+ value: e.target.value
211
+ }
212
+ }),
213
+ fullWidth: true,
214
+ size: size
215
+ }, options.map((option)=>React.createElement(MenuItem, {
216
+ key: option.value,
217
+ value: option.value
218
+ }, React.createElement(Stack, {
219
+ key: 'stack'
220
+ }, [
221
+ React.createElement(Typography, {
222
+ key: 'title'
223
+ }, option.label),
224
+ React.createElement(Typography, {
225
+ key: 'caption',
226
+ variant: 'caption'
227
+ }, option.caption)
228
+ ]))));
229
+ }
230
+ return null;
231
+ }
232
+
233
+ //# sourceMappingURL=table-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/models/table-model.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\nimport { Definition, FormatOptions, Transform, UnknownSpec } from '@perses-dev/core';\nimport { TableDensity, TableCellConfig } from '@perses-dev/components';\nimport { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport React from 'react';\nimport { TextField, Stack, MenuItem, Typography } from '@mui/material';\n\nexport interface ColumnSettings {\n name: string;\n\n // Text to display in the header for the column.\n header?: string;\n /**\n * Text to display when hovering over the header text. This can be useful for\n * providing additional information about the column when you want to keep the\n * header text relatively short to manage the column width.\n */\n headerDescription?: string;\n /**\n * Text to display when hovering over a cell. This can be useful for\n * providing additional information about the column when the content is\n * ellipsized to fit in the space.\n */\n cellDescription?: string;\n\n /**\n * Panel plugin to render.\n * By default, the cells are rendered as text.\n */\n plugin?: Definition<UnknownSpec>;\n\n /** Formatting options. Only applicable if plugin is unset. */\n format?: FormatOptions;\n\n // Alignment of the content in the cell.\n align?: 'left' | 'center' | 'right';\n\n // When `true`, the column will be sortable.\n enableSorting?: boolean;\n\n // Default sort order for the column.\n sort?: 'asc' | 'desc';\n\n /**\n * Width of the column when rendered in a table. It should be a number in pixels\n * or \"auto\" to allow the table to automatically adjust the width to fill\n * space.\n */\n width?: number | 'auto';\n // When `true`, the column will not be displayed.\n hide?: boolean;\n // Customize cell display based on their value for this specific column.\n cellSettings?: CellSettings[];\n}\n\nexport interface ValueCondition {\n kind: 'Value';\n spec: {\n value: string;\n };\n}\n\nexport interface RangeCondition {\n kind: 'Range';\n spec: {\n min?: number;\n max?: number;\n };\n}\n\nexport interface RegexCondition {\n kind: 'Regex';\n spec: {\n expr: string;\n };\n}\n\nexport interface MiscCondition {\n kind: 'Misc';\n spec: {\n value: 'empty' | 'null' | 'NaN' | 'true' | 'false';\n };\n}\n\nexport type Condition = ValueCondition | RangeCondition | RegexCondition | MiscCondition;\n\nexport interface CellSettings {\n condition: Condition;\n text?: string;\n prefix?: string;\n suffix?: string;\n textColor?: `#${string}`;\n backgroundColor?: `#${string}`;\n}\n\n/**\n * The schema for a Table panel.\n */\nexport interface TableDefinition extends Definition<TableOptions> {\n kind: 'Table';\n}\n\n/**\n * The Options object type supported by the Table panel plugin.\n */\nexport interface TableOptions {\n // Change row height.\n density?: TableDensity;\n // When set to 'auto', the table will try to automatically adjust the width of columns to fit without overflowing.\n // Only for column without custom width specified in columnSettings.\n defaultColumnWidth?: 'auto' | number;\n // When set to 'auto', the table will calculate the cell height based on the line height of the theme and the density setting of the table.\n // Only for column without custom height specified in columnSettings.\n defaultColumnHeight?: 'auto' | number;\n // When true, columns are hidden by default unless specified in columnSettings.\n defaultColumnHidden?: boolean;\n // Enable pagination.\n pagination?: boolean;\n // Enable filtering for individual columns.\n enableFiltering?: boolean;\n // Customize column display and order them by their index in the array.\n columnSettings?: ColumnSettings[];\n // Customize cell display based on their value.\n cellSettings?: CellSettings[];\n // Apply transforms to the data before rendering the table.\n transforms?: Transform[];\n}\n\n/**\n * Creates the initial/empty options for a Table panel.\n */\nexport function createInitialTableOptions(): TableOptions {\n return {\n density: 'standard',\n enableFiltering: true,\n };\n}\n\nexport type TableSettingsEditorProps = OptionsEditorProps<TableOptions>;\n\n/**\n * Formats the display text and colors based on cell settings\n */\nexport function formatCellDisplay(value: unknown, setting: CellSettings, defaultText?: string): TableCellConfig {\n const baseText = setting.text || defaultText || String(value);\n const displayText = `${setting.prefix ?? ''}${baseText}${setting.suffix ?? ''}`;\n return {\n text: displayText,\n textColor: setting.textColor,\n backgroundColor: setting.backgroundColor,\n };\n}\n\n/**\n * Evaluates if a condition matches the given value\n */\nexport function evaluateCondition(condition: Condition, value: unknown): boolean {\n switch (condition.kind) {\n case 'Value':\n return condition.spec?.value === String(value);\n\n case 'Range': {\n if (Number.isNaN(Number(value))) return false;\n const numericValue = Number(value);\n\n // Both min and max defined\n if (condition.spec?.min !== undefined && condition.spec?.max !== undefined) {\n return numericValue >= +condition.spec.min && numericValue <= +condition.spec.max;\n }\n\n // Only min defined\n if (condition.spec?.min !== undefined) {\n return numericValue >= +condition.spec.min;\n }\n\n // Only max defined\n if (condition.spec?.max !== undefined) {\n return numericValue <= +condition.spec.max;\n }\n\n return false;\n }\n\n case 'Regex':\n if (!condition.spec?.expr) return false;\n try {\n const regex = new RegExp(condition.spec.expr);\n return regex.test(String(value));\n } catch {\n return false; // Invalid regex\n }\n\n case 'Misc':\n switch (condition.spec?.value) {\n case 'empty':\n return value === '';\n case 'null':\n return value === null || value === undefined;\n case 'NaN':\n return Number.isNaN(value);\n case 'true':\n return value === true;\n case 'false':\n return value === false;\n default:\n return false;\n }\n\n default:\n return false;\n }\n}\n\n/**\n * Evaluates all conditions and returns the cell config for the first matching condition\n */\nexport function evaluateConditionalFormatting(value: unknown, settings: CellSettings[]): TableCellConfig | undefined {\n for (const setting of settings) {\n if (evaluateCondition(setting.condition, value)) {\n // Handle special default text cases\n let defaultText: string | undefined;\n if (setting.condition.kind === 'Misc') {\n switch (setting.condition.spec?.value) {\n case 'null':\n defaultText = 'null';\n break;\n case 'NaN':\n defaultText = 'NaN';\n break;\n }\n }\n\n return formatCellDisplay(value, setting, defaultText);\n }\n }\n\n return undefined; // No conditions matched\n}\n\n/**\n * Renders the condition editor component for a given condition\n * This function can be used by both CellEditor and ColumnEditor to maintain consistency\n */\nexport function renderConditionEditor(\n condition: Condition,\n onChange: (condition: Condition) => void,\n size: 'small' | 'medium' = 'small'\n): React.ReactElement | null {\n if (condition.kind === 'Value') {\n return React.createElement(TextField, {\n label: 'Value',\n placeholder: 'Exact value',\n value: condition.spec?.value ?? '',\n onChange: (e: { target: { value: string } }) =>\n onChange({ ...condition, spec: { value: e.target.value } } as ValueCondition),\n fullWidth: true,\n size: size,\n });\n } else if (condition.kind === 'Range') {\n return React.createElement(\n Stack,\n {\n gap: 1,\n direction: 'row',\n },\n [\n React.createElement(TextField, {\n key: 'min',\n label: 'From',\n placeholder: 'Start of range',\n value: condition.spec?.min ?? '',\n onChange: (e: { target: { value: string } }) =>\n onChange({ ...condition, spec: { ...condition.spec, min: +e.target.value } } as RangeCondition),\n fullWidth: true,\n size: size,\n }),\n React.createElement(TextField, {\n key: 'max',\n label: 'To',\n placeholder: 'End of range (inclusive)',\n value: condition.spec?.max ?? '',\n onChange: (e: { target: { value: string } }) =>\n onChange({ ...condition, spec: { ...condition.spec, max: +e.target.value } } as RangeCondition),\n fullWidth: true,\n size: size,\n }),\n ]\n );\n } else if (condition.kind === 'Regex') {\n return React.createElement(TextField, {\n label: 'Regular Expression',\n placeholder: 'JavaScript regular expression',\n value: condition.spec?.expr ?? '',\n onChange: (e: { target: { value: string } }) =>\n onChange({ ...condition, spec: { expr: e.target.value } } as RegexCondition),\n fullWidth: true,\n size: size,\n });\n } else if (condition.kind === 'Misc') {\n const options = [\n { value: 'empty', label: 'Empty', caption: 'Matches empty string' },\n { value: 'null', label: 'Null', caption: 'Matches null or undefined' },\n { value: 'NaN', label: 'NaN', caption: 'Matches Not a Number value' },\n { value: 'true', label: 'True', caption: 'Matches true boolean' },\n { value: 'false', label: 'False', caption: 'Matches false boolean' },\n ];\n\n return React.createElement(\n TextField,\n {\n select: true,\n label: 'Value',\n value: condition.spec?.value ?? '',\n onChange: (e: { target: { value: string } }) =>\n onChange({ ...condition, spec: { value: e.target.value } } as MiscCondition),\n fullWidth: true,\n size: size,\n },\n options.map((option) =>\n React.createElement(\n MenuItem,\n {\n key: option.value,\n value: option.value,\n },\n React.createElement(Stack, { key: 'stack' }, [\n React.createElement(Typography, { key: 'title' }, option.label),\n React.createElement(\n Typography,\n {\n key: 'caption',\n variant: 'caption',\n },\n option.caption\n ),\n ])\n )\n )\n );\n }\n return null;\n}\n"],"names":["React","TextField","Stack","MenuItem","Typography","createInitialTableOptions","density","enableFiltering","formatCellDisplay","value","setting","defaultText","baseText","text","String","displayText","prefix","suffix","textColor","backgroundColor","evaluateCondition","condition","kind","spec","Number","isNaN","numericValue","min","undefined","max","expr","regex","RegExp","test","evaluateConditionalFormatting","settings","renderConditionEditor","onChange","size","createElement","label","placeholder","e","target","fullWidth","gap","direction","key","options","caption","select","map","option","variant"],"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,OAAOA,WAAW,QAAQ;AAC1B,SAASC,S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