@perses-dev/components 0.55.0 → 0.56.0-beta.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 (201) hide show
  1. package/dist/AlignSelector/AlignSelector.js +115 -25
  2. package/dist/AlignSelector/AlignSelector.js.map +1 -1
  3. package/dist/CodeEditor/CodeEditor.d.ts +19 -0
  4. package/dist/CodeEditor/CodeEditor.d.ts.map +1 -0
  5. package/dist/CodeEditor/CodeEditor.js +122 -0
  6. package/dist/CodeEditor/CodeEditor.js.map +1 -0
  7. package/dist/ColorPicker/ColorPicker.js +153 -61
  8. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  9. package/dist/ColorPicker/OptionsColorPicker.js +147 -52
  10. package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
  11. package/dist/ContentWithLegend/ContentWithLegend.js +144 -41
  12. package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
  13. package/dist/DensitySelector/DensitySelector.js +53 -20
  14. package/dist/DensitySelector/DensitySelector.js.map +1 -1
  15. package/dist/Dialog/Dialog.d.ts +3 -2
  16. package/dist/Dialog/Dialog.d.ts.map +1 -1
  17. package/dist/Dialog/Dialog.js +202 -49
  18. package/dist/Dialog/Dialog.js.map +1 -1
  19. package/dist/Dialog/DiscardChangesConfirmationDialog.js +79 -27
  20. package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
  21. package/dist/DragAndDrop/DragAndDropList.js +184 -113
  22. package/dist/DragAndDrop/DragAndDropList.js.map +1 -1
  23. package/dist/DragAndDrop/DragButton.js +131 -52
  24. package/dist/DragAndDrop/DragButton.js.map +1 -1
  25. package/dist/DragAndDrop/DropIndicator.js +51 -26
  26. package/dist/DragAndDrop/DropIndicator.js.map +1 -1
  27. package/dist/Drawer/Drawer.js +75 -15
  28. package/dist/Drawer/Drawer.js.map +1 -1
  29. package/dist/EChart/EChart.js +179 -90
  30. package/dist/EChart/EChart.js.map +1 -1
  31. package/dist/ErrorAlert.js +14 -4
  32. package/dist/ErrorAlert.js.map +1 -1
  33. package/dist/ExemplarMetadata/ExemplarMetadataTooltip.js +463 -190
  34. package/dist/ExemplarMetadata/ExemplarMetadataTooltip.js.map +1 -1
  35. package/dist/FontSizeSelector/FontSizeSelector.js +82 -50
  36. package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
  37. package/dist/FormEditor/FormActions.js +88 -14
  38. package/dist/FormEditor/FormActions.js.map +1 -1
  39. package/dist/FormatControls/FormatControls.js +246 -99
  40. package/dist/FormatControls/FormatControls.js.map +1 -1
  41. package/dist/FormatControls/UnitSelector.js +90 -25
  42. package/dist/FormatControls/UnitSelector.js.map +1 -1
  43. package/dist/InfoTooltip/InfoTooltip.js +105 -42
  44. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  45. package/dist/JSONEditor.d.ts +2 -6
  46. package/dist/JSONEditor.d.ts.map +1 -1
  47. package/dist/JSONEditor.js +24 -37
  48. package/dist/JSONEditor.js.map +1 -1
  49. package/dist/Legend/CompactLegend.js +77 -27
  50. package/dist/Legend/CompactLegend.js.map +1 -1
  51. package/dist/Legend/Legend.js +184 -82
  52. package/dist/Legend/Legend.js.map +1 -1
  53. package/dist/Legend/LegendColorBadge.js +54 -9
  54. package/dist/Legend/LegendColorBadge.js.map +1 -1
  55. package/dist/Legend/ListLegend.js +46 -16
  56. package/dist/Legend/ListLegend.js.map +1 -1
  57. package/dist/Legend/ListLegendItem.js +184 -48
  58. package/dist/Legend/ListLegendItem.js.map +1 -1
  59. package/dist/Legend/TableLegend.d.ts.map +1 -1
  60. package/dist/Legend/TableLegend.js +90 -48
  61. package/dist/Legend/TableLegend.js.map +1 -1
  62. package/dist/Legend/legend-model.d.ts +2 -2
  63. package/dist/Legend/legend-model.d.ts.map +1 -1
  64. package/dist/Legend/legend-model.js.map +1 -1
  65. package/dist/LinksEditor/LinkEditorForm.js +148 -67
  66. package/dist/LinksEditor/LinkEditorForm.js.map +1 -1
  67. package/dist/ModeSelector/ModeSelector.js +61 -19
  68. package/dist/ModeSelector/ModeSelector.js.map +1 -1
  69. package/dist/OptionsEditorLayout/OptionsEditorColumn.js +20 -9
  70. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
  71. package/dist/OptionsEditorLayout/OptionsEditorControl.js +130 -54
  72. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  73. package/dist/OptionsEditorLayout/OptionsEditorGrid.js +17 -6
  74. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
  75. package/dist/OptionsEditorLayout/OptionsEditorGroup.js +76 -28
  76. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  77. package/dist/Overlay/Overlay.js +71 -27
  78. package/dist/Overlay/Overlay.js.map +1 -1
  79. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +96 -38
  80. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  81. package/dist/RepeatGrid/RepeatGrid.js +117 -45
  82. package/dist/RepeatGrid/RepeatGrid.js.map +1 -1
  83. package/dist/SettingsAutocomplete/SettingsAutocomplete.js +99 -38
  84. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  85. package/dist/SortSelector/SortSelector.js +51 -18
  86. package/dist/SortSelector/SortSelector.js.map +1 -1
  87. package/dist/SortSelector/SortSelectorButtons.js +109 -25
  88. package/dist/SortSelector/SortSelectorButtons.js.map +1 -1
  89. package/dist/Table/InnerTable.js +46 -15
  90. package/dist/Table/InnerTable.js.map +1 -1
  91. package/dist/Table/Table.d.ts +3 -1
  92. package/dist/Table/Table.d.ts.map +1 -1
  93. package/dist/Table/Table.js +410 -158
  94. package/dist/Table/Table.js.map +1 -1
  95. package/dist/Table/TableBody.js +15 -4
  96. package/dist/Table/TableBody.js.map +1 -1
  97. package/dist/Table/TableCell.js +284 -107
  98. package/dist/Table/TableCell.js.map +1 -1
  99. package/dist/Table/TableCheckbox.js +101 -32
  100. package/dist/Table/TableCheckbox.js.map +1 -1
  101. package/dist/Table/TableFoot.js +15 -4
  102. package/dist/Table/TableFoot.js.map +1 -1
  103. package/dist/Table/TableHead.js +15 -4
  104. package/dist/Table/TableHead.js.map +1 -1
  105. package/dist/Table/TableHeaderCell.js +119 -62
  106. package/dist/Table/TableHeaderCell.js.map +1 -1
  107. package/dist/Table/TableRow.js +33 -9
  108. package/dist/Table/TableRow.js.map +1 -1
  109. package/dist/Table/TableToolbar.d.ts +5 -4
  110. package/dist/Table/TableToolbar.d.ts.map +1 -1
  111. package/dist/Table/TableToolbar.js +172 -100
  112. package/dist/Table/TableToolbar.js.map +1 -1
  113. package/dist/Table/VirtualizedTable.d.ts +11 -11
  114. package/dist/Table/VirtualizedTable.d.ts.map +1 -1
  115. package/dist/Table/VirtualizedTable.js +387 -219
  116. package/dist/Table/VirtualizedTable.js.map +1 -1
  117. package/dist/Table/VirtualizedTableContainer.js +27 -7
  118. package/dist/Table/VirtualizedTableContainer.js.map +1 -1
  119. package/dist/Table/hooks/useFuzzySearch.d.ts +6 -5
  120. package/dist/Table/hooks/useFuzzySearch.d.ts.map +1 -1
  121. package/dist/Table/hooks/useFuzzySearch.js +57 -32
  122. package/dist/Table/hooks/useFuzzySearch.js.map +1 -1
  123. package/dist/Table/hooks/useTableKeyboardNav.js +115 -74
  124. package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
  125. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts +1 -1
  126. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts.map +1 -1
  127. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +74 -53
  128. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
  129. package/dist/Table/model/table-model.d.ts +44 -15
  130. package/dist/Table/model/table-model.d.ts.map +1 -1
  131. package/dist/Table/model/table-model.js +33 -1
  132. package/dist/Table/model/table-model.js.map +1 -1
  133. package/dist/ThresholdsEditor/ThresholdInput.js +137 -47
  134. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  135. package/dist/ThresholdsEditor/ThresholdsEditor.js +341 -174
  136. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  137. package/dist/TimeRangeSelector/DateTimeRangePicker.js +368 -162
  138. package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
  139. package/dist/TimeRangeSelector/TimeRangeSelector.js +580 -209
  140. package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
  141. package/dist/TimeSeriesTooltip/SeriesInfo.js +189 -65
  142. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  143. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +168 -78
  144. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  145. package/dist/TimeSeriesTooltip/SeriesMarker.js +38 -11
  146. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
  147. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +229 -72
  148. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  149. package/dist/TimeSeriesTooltip/TooltipContent.js +73 -27
  150. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
  151. package/dist/TimeSeriesTooltip/TooltipHeader.js +221 -121
  152. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  153. package/dist/TimeSeriesTooltip/tooltip-model.js +44 -38
  154. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  155. package/dist/TimeZoneSelector.js +131 -36
  156. package/dist/TimeZoneSelector.js.map +1 -1
  157. package/dist/ToolbarIconButton/ToolbarIconButton.js +18 -7
  158. package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
  159. package/dist/TransformsEditor/TransformEditor.js +830 -334
  160. package/dist/TransformsEditor/TransformEditor.js.map +1 -1
  161. package/dist/TransformsEditor/TransformEditorContainer.js +252 -90
  162. package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
  163. package/dist/TransformsEditor/TransformsEditor.js +170 -59
  164. package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
  165. package/dist/ValueMappingEditor/ValueMappingEditor.js +800 -322
  166. package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -1
  167. package/dist/ValueMappingEditor/ValueMappingsEditor.js +218 -91
  168. package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -1
  169. package/dist/YAMLEditor/YAMLEditor.d.ts +12 -0
  170. package/dist/YAMLEditor/YAMLEditor.d.ts.map +1 -0
  171. package/dist/YAMLEditor/YAMLEditor.js +41 -0
  172. package/dist/YAMLEditor/YAMLEditor.js.map +1 -0
  173. package/dist/YAMLEditor/index.d.ts +2 -0
  174. package/dist/YAMLEditor/index.d.ts.map +1 -0
  175. package/dist/YAMLEditor/index.js +15 -0
  176. package/dist/YAMLEditor/index.js.map +1 -0
  177. package/dist/YAMLEditor/yaml-utils.d.ts +11 -0
  178. package/dist/YAMLEditor/yaml-utils.d.ts.map +1 -0
  179. package/dist/YAMLEditor/yaml-utils.js +52 -0
  180. package/dist/YAMLEditor/yaml-utils.js.map +1 -0
  181. package/dist/YAxisLabel.js +64 -20
  182. package/dist/YAxisLabel.js.map +1 -1
  183. package/dist/context/ChartsProvider.js +32 -16
  184. package/dist/context/ChartsProvider.js.map +1 -1
  185. package/dist/context/ItemActionsProvider.js +110 -61
  186. package/dist/context/ItemActionsProvider.js.map +1 -1
  187. package/dist/context/SelectionProvider.js +170 -66
  188. package/dist/context/SelectionProvider.js.map +1 -1
  189. package/dist/context/SnackbarProvider.js +101 -44
  190. package/dist/context/SnackbarProvider.js.map +1 -1
  191. package/dist/context/TimeZoneProvider.js +35 -14
  192. package/dist/context/TimeZoneProvider.js.map +1 -1
  193. package/dist/controls/TextField.js +86 -25
  194. package/dist/controls/TextField.js.map +1 -1
  195. package/dist/index.d.ts +1 -0
  196. package/dist/index.d.ts.map +1 -1
  197. package/dist/index.js +1 -0
  198. package/dist/index.js.map +1 -1
  199. package/dist/utils/browser-storage.js +64 -34
  200. package/dist/utils/browser-storage.js.map +1 -1
  201. package/package.json +12 -6
@@ -11,39 +11,108 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { c as _c } from "react-compiler-runtime";
14
15
  import { Checkbox, alpha } from "@mui/material";
15
- export function TableCheckbox({ color, density, ...otherProps }) {
16
- const isCompact = density === 'compact';
17
- return /*#__PURE__*/ _jsx(Checkbox, {
18
- size: isCompact ? 'small' : 'medium',
19
- ...otherProps,
20
- // Disable ripple and set background color below because of some issues
21
- // with re-rendering with the keyboard interactions that causes the ripple
22
- // animation to stutter.
23
- focusRipple: false,
24
- // Tab index is handled by the overall keyboard interactions for the table
25
- // to avoid trapping a keyboard user in a table by requiring them to tab
26
- // through every single checkbox.
27
- tabIndex: -1,
28
- sx: {
29
- color: color,
30
- padding: (theme)=>theme.spacing(isCompact ? 0.25 : 0.5),
31
- // Centering.
32
- position: 'absolute',
33
- top: '50%',
34
- left: '50%',
35
- transform: 'translate(-50%, -50%)',
36
- '&.Mui-checked': {
37
- color: color
38
- },
39
- '&.Mui-focusVisible': {
40
- background: color ? alpha(color, 0.5) : undefined
41
- },
42
- '& .MuiSvgIcon-root': {
43
- fontSize: isCompact ? 16 : 18
44
- }
45
- }
46
- });
16
+ export function TableCheckbox(t0) {
17
+ const $ = _c(23);
18
+ let color;
19
+ let density;
20
+ let otherProps;
21
+ if ($[0] !== t0) {
22
+ ({ color, density, ...otherProps } = t0);
23
+ $[0] = t0;
24
+ $[1] = color;
25
+ $[2] = density;
26
+ $[3] = otherProps;
27
+ } else {
28
+ color = $[1];
29
+ density = $[2];
30
+ otherProps = $[3];
31
+ }
32
+ const isCompact = density === "compact";
33
+ const t1 = isCompact ? "small" : "medium";
34
+ let t2;
35
+ if ($[4] !== isCompact) {
36
+ t2 = (theme)=>theme.spacing(isCompact ? 0.25 : 0.5);
37
+ $[4] = isCompact;
38
+ $[5] = t2;
39
+ } else {
40
+ t2 = $[5];
41
+ }
42
+ let t3;
43
+ let t4;
44
+ if ($[6] !== color) {
45
+ t3 = {
46
+ color
47
+ };
48
+ t4 = color ? alpha(color, 0.5) : undefined;
49
+ $[6] = color;
50
+ $[7] = t3;
51
+ $[8] = t4;
52
+ } else {
53
+ t3 = $[7];
54
+ t4 = $[8];
55
+ }
56
+ let t5;
57
+ if ($[9] !== t4) {
58
+ t5 = {
59
+ background: t4
60
+ };
61
+ $[9] = t4;
62
+ $[10] = t5;
63
+ } else {
64
+ t5 = $[10];
65
+ }
66
+ const t6 = isCompact ? 16 : 18;
67
+ let t7;
68
+ if ($[11] !== t6) {
69
+ t7 = {
70
+ fontSize: t6
71
+ };
72
+ $[11] = t6;
73
+ $[12] = t7;
74
+ } else {
75
+ t7 = $[12];
76
+ }
77
+ let t8;
78
+ if ($[13] !== color || $[14] !== t2 || $[15] !== t3 || $[16] !== t5 || $[17] !== t7) {
79
+ t8 = {
80
+ color,
81
+ padding: t2,
82
+ position: "absolute",
83
+ top: "50%",
84
+ left: "50%",
85
+ transform: "translate(-50%, -50%)",
86
+ "&.Mui-checked": t3,
87
+ "&.Mui-focusVisible": t5,
88
+ "& .MuiSvgIcon-root": t7
89
+ };
90
+ $[13] = color;
91
+ $[14] = t2;
92
+ $[15] = t3;
93
+ $[16] = t5;
94
+ $[17] = t7;
95
+ $[18] = t8;
96
+ } else {
97
+ t8 = $[18];
98
+ }
99
+ let t9;
100
+ if ($[19] !== otherProps || $[20] !== t1 || $[21] !== t8) {
101
+ t9 = /*#__PURE__*/ _jsx(Checkbox, {
102
+ size: t1,
103
+ ...otherProps,
104
+ focusRipple: false,
105
+ tabIndex: -1,
106
+ sx: t8
107
+ });
108
+ $[19] = otherProps;
109
+ $[20] = t1;
110
+ $[21] = t8;
111
+ $[22] = t9;
112
+ } else {
113
+ t9 = $[22];
114
+ }
115
+ return t9;
47
116
  }
48
117
 
49
118
  //# sourceMappingURL=TableCheckbox.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/TableCheckbox.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { CheckboxProps } from '@mui/material';\nimport { Checkbox, alpha } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport type { TableDensity } from './model/table-model';\n\nexport interface TableCheckboxProps extends Pick<CheckboxProps, 'checked' | 'indeterminate' | 'onChange'> {\n color?: string;\n density: TableDensity;\n}\n\nexport function TableCheckbox({ color, density, ...otherProps }: TableCheckboxProps): ReactElement {\n const isCompact = density === 'compact';\n\n return (\n <Checkbox\n size={isCompact ? 'small' : 'medium'}\n {...otherProps}\n // Disable ripple and set background color below because of some issues\n // with re-rendering with the keyboard interactions that causes the ripple\n // animation to stutter.\n focusRipple={false}\n // Tab index is handled by the overall keyboard interactions for the table\n // to avoid trapping a keyboard user in a table by requiring them to tab\n // through every single checkbox.\n tabIndex={-1}\n sx={{\n color: color,\n\n padding: (theme) => theme.spacing(isCompact ? 0.25 : 0.5),\n\n // Centering.\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n\n '&.Mui-checked': {\n color: color,\n },\n\n '&.Mui-focusVisible': {\n background: color ? alpha(color, 0.5) : undefined,\n },\n\n '& .MuiSvgIcon-root': { fontSize: isCompact ? 16 : 18 },\n }}\n />\n );\n}\n"],"names":["Checkbox","alpha","TableCheckbox","color","density","otherProps","isCompact","size","focusRipple","tabIndex","sx","padding","theme","spacing","position","top","left","transform","background","undefined","fontSize"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,QAAQ,EAAEC,KAAK,QAAQ,gBAAgB;AAUhD,OAAO,SAASC,cAAc,EAAEC,KAAK,EAAEC,OAAO,EAAE,GAAGC,YAAgC;IACjF,MAAMC,YAAYF,YAAY;IAE9B,qBACE,KAACJ;QACCO,MAAMD,YAAY,UAAU;QAC3B,GAAGD,UAAU;QACd,uEAAuE;QACvE,0EAA0E;QAC1E,wBAAwB;QACxBG,aAAa;QACb,0EAA0E;QAC1E,wEAAwE;QACxE,iCAAiC;QACjCC,UAAU,CAAC;QACXC,IAAI;YACFP,OAAOA;YAEPQ,SAAS,CAACC,QAAUA,MAAMC,OAAO,CAACP,YAAY,OAAO;YAErD,aAAa;YACbQ,UAAU;YACVC,KAAK;YACLC,MAAM;YACNC,WAAW;YAEX,iBAAiB;gBACfd,OAAOA;YACT;YAEA,sBAAsB;gBACpBe,YAAYf,QAAQF,MAAME,OAAO,OAAOgB;YAC1C;YAEA,sBAAsB;gBAAEC,UAAUd,YAAY,KAAK;YAAG;QACxD;;AAGN"}
1
+ {"version":3,"sources":["../../src/Table/TableCheckbox.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { CheckboxProps } from '@mui/material';\nimport { Checkbox, alpha } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport type { TableDensity } from './model/table-model';\n\nexport interface TableCheckboxProps extends Pick<CheckboxProps, 'checked' | 'indeterminate' | 'onChange'> {\n color?: string;\n density: TableDensity;\n}\n\nexport function TableCheckbox({ color, density, ...otherProps }: TableCheckboxProps): ReactElement {\n const isCompact = density === 'compact';\n\n return (\n <Checkbox\n size={isCompact ? 'small' : 'medium'}\n {...otherProps}\n // Disable ripple and set background color below because of some issues\n // with re-rendering with the keyboard interactions that causes the ripple\n // animation to stutter.\n focusRipple={false}\n // Tab index is handled by the overall keyboard interactions for the table\n // to avoid trapping a keyboard user in a table by requiring them to tab\n // through every single checkbox.\n tabIndex={-1}\n sx={{\n color: color,\n\n padding: (theme) => theme.spacing(isCompact ? 0.25 : 0.5),\n\n // Centering.\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n\n '&.Mui-checked': {\n color: color,\n },\n\n '&.Mui-focusVisible': {\n background: color ? alpha(color, 0.5) : undefined,\n },\n\n '& .MuiSvgIcon-root': { fontSize: isCompact ? 16 : 18 },\n }}\n />\n );\n}\n"],"names":["Checkbox","alpha"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAGjC,SAASA,QAAQ,EAAEC,KAAK,QAAQ,gBAAgB;AAUhD,OAAO"}
@@ -11,13 +11,24 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { c as _c } from "react-compiler-runtime";
14
15
  import { TableFooter as MuiTableFooter } from "@mui/material";
15
16
  import { forwardRef } from "react";
16
17
  export const TableFoot = /*#__PURE__*/ forwardRef(function TableFoot(props, ref) {
17
- return /*#__PURE__*/ _jsx(MuiTableFooter, {
18
- ...props,
19
- ref: ref
20
- });
18
+ const $ = _c(3);
19
+ let t0;
20
+ if ($[0] !== props || $[1] !== ref) {
21
+ t0 = /*#__PURE__*/ _jsx(MuiTableFooter, {
22
+ ...props,
23
+ ref: ref
24
+ });
25
+ $[0] = props;
26
+ $[1] = ref;
27
+ $[2] = t0;
28
+ } else {
29
+ t0 = $[2];
30
+ }
31
+ return t0;
21
32
  });
22
33
 
23
34
  //# sourceMappingURL=TableFoot.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/TableFoot.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { TableFooterProps as MuiTableFooterProps } from '@mui/material';\nimport { TableFooter as MuiTableFooter } from '@mui/material';\nimport { forwardRef } from 'react';\n\nexport const TableFoot = forwardRef<HTMLTableSectionElement, MuiTableFooterProps>(function TableFoot(props, ref) {\n return <MuiTableFooter {...props} ref={ref} />;\n});\n"],"names":["TableFooter","MuiTableFooter","forwardRef","TableFoot","props","ref"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,eAAeC,cAAc,QAAQ,gBAAgB;AAC9D,SAASC,UAAU,QAAQ,QAAQ;AAEnC,OAAO,MAAMC,0BAAYD,WAAyD,SAASC,UAAUC,KAAK,EAAEC,GAAG;IAC7G,qBAAO,KAACJ;QAAgB,GAAGG,KAAK;QAAEC,KAAKA;;AACzC,GAAG"}
1
+ {"version":3,"sources":["../../src/Table/TableFoot.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { TableFooterProps as MuiTableFooterProps } from '@mui/material';\nimport { TableFooter as MuiTableFooter } from '@mui/material';\nimport { forwardRef } from 'react';\n\nexport const TableFoot = forwardRef<HTMLTableSectionElement, MuiTableFooterProps>(function TableFoot(props, ref) {\n return <MuiTableFooter {...props} ref={ref} />;\n});\n"],"names":["TableFooter","MuiTableFooter","forwardRef","TableFoot"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAGjC,SAASA,eAAeC,cAAc,QAAQ,gBAAgB;AAC9D,SAASC,UAAU,QAAQ,QAAQ;AAEnC,OAAO,MAAMC,0BAAYD,WAAyD;;;;;;;;;;;;;;;GAE/E"}
@@ -11,13 +11,24 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { c as _c } from "react-compiler-runtime";
14
15
  import { TableHead as MuiTableHead } from "@mui/material";
15
16
  import { forwardRef } from "react";
16
17
  export const TableHead = /*#__PURE__*/ forwardRef(function TableHead(props, ref) {
17
- return /*#__PURE__*/ _jsx(MuiTableHead, {
18
- ...props,
19
- ref: ref
20
- });
18
+ const $ = _c(3);
19
+ let t0;
20
+ if ($[0] !== props || $[1] !== ref) {
21
+ t0 = /*#__PURE__*/ _jsx(MuiTableHead, {
22
+ ...props,
23
+ ref: ref
24
+ });
25
+ $[0] = props;
26
+ $[1] = ref;
27
+ $[2] = t0;
28
+ } else {
29
+ t0 = $[2];
30
+ }
31
+ return t0;
21
32
  });
22
33
 
23
34
  //# sourceMappingURL=TableHead.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/TableHead.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { TableHeadProps as MuiTableHeadProps } from '@mui/material';\nimport { TableHead as MuiTableHead } from '@mui/material';\nimport { forwardRef } from 'react';\n\ntype TableHeadProps = MuiTableHeadProps;\n\nexport const TableHead = forwardRef<HTMLTableSectionElement, TableHeadProps>(function TableHead(props, ref) {\n return <MuiTableHead {...props} ref={ref} />;\n});\n"],"names":["TableHead","MuiTableHead","forwardRef","props","ref"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,aAAaC,YAAY,QAAQ,gBAAgB;AAC1D,SAASC,UAAU,QAAQ,QAAQ;AAInC,OAAO,MAAMF,0BAAYE,WAAoD,SAASF,UAAUG,KAAK,EAAEC,GAAG;IACxG,qBAAO,KAACH;QAAc,GAAGE,KAAK;QAAEC,KAAKA;;AACvC,GAAG"}
1
+ {"version":3,"sources":["../../src/Table/TableHead.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { TableHeadProps as MuiTableHeadProps } from '@mui/material';\nimport { TableHead as MuiTableHead } from '@mui/material';\nimport { forwardRef } from 'react';\n\ntype TableHeadProps = MuiTableHeadProps;\n\nexport const TableHead = forwardRef<HTMLTableSectionElement, TableHeadProps>(function TableHead(props, ref) {\n return <MuiTableHead {...props} ref={ref} />;\n});\n"],"names":["TableHead","MuiTableHead","forwardRef"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAGjC,SAASA,aAAaC,YAAY,QAAQ,gBAAgB;AAC1D,SAASC,UAAU,QAAQ,QAAQ;AAInC,OAAO,MAAMF,0BAAYE,WAAoD;;;;;;;;;;;;;;;GAE1E"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
2
3
  // Copyright The Perses Authors
3
4
  // Licensed under the Apache License, Version 2.0 (the "License");
4
5
  // you may not use this file except in compliance with the License.
@@ -13,73 +14,129 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
14
  // limitations under the License.
14
15
  import { TableSortLabel, Typography, tableSortLabelClasses, Box, Divider } from "@mui/material";
15
16
  import { TableCell } from "./TableCell.js";
16
- export function TableHeaderCell({ onSort, sortDirection, nextSortDirection, children, resizeConfig, ...cellProps }) {
17
+ export function TableHeaderCell(t0) {
18
+ const $ = _c(21);
19
+ let cellProps;
20
+ let children;
21
+ let nextSortDirection;
22
+ let onSort;
23
+ let resizeConfig;
24
+ let sortDirection;
25
+ if ($[0] !== t0) {
26
+ ({ onSort, sortDirection, nextSortDirection, children, resizeConfig, ...cellProps } = t0);
27
+ $[0] = t0;
28
+ $[1] = cellProps;
29
+ $[2] = children;
30
+ $[3] = nextSortDirection;
31
+ $[4] = onSort;
32
+ $[5] = resizeConfig;
33
+ $[6] = sortDirection;
34
+ } else {
35
+ cellProps = $[1];
36
+ children = $[2];
37
+ nextSortDirection = $[3];
38
+ onSort = $[4];
39
+ resizeConfig = $[5];
40
+ sortDirection = $[6];
41
+ }
17
42
  const showSortLabel = !!onSort;
18
- const headerText = /*#__PURE__*/ _jsx(Typography, {
19
- noWrap: true,
20
- variant: "inherit",
21
- component: "div",
22
- color: "inherit",
23
- children: children
24
- });
43
+ let t1;
44
+ if ($[7] !== children) {
45
+ t1 = /*#__PURE__*/ _jsx(Typography, {
46
+ noWrap: true,
47
+ variant: "inherit",
48
+ component: "div",
49
+ color: "inherit",
50
+ children: children
51
+ });
52
+ $[7] = children;
53
+ $[8] = t1;
54
+ } else {
55
+ t1 = $[8];
56
+ }
57
+ const headerText = t1;
25
58
  const isActive = !!sortDirection;
26
59
  const direction = isActive ? sortDirection : nextSortDirection;
27
- return /*#__PURE__*/ _jsxs(TableCell, {
28
- ...cellProps,
29
- children: [
30
- showSortLabel ? /*#__PURE__*/ _jsx(TableSortLabel, {
31
- onClick: onSort,
32
- direction: direction,
33
- active: isActive,
34
- sx: {
35
- // Overrides a default vertical alignment in the CSS that changes
36
- // the header vertical rhythm in a way that's inconsistent with
37
- // non-sorting headers.
38
- verticalAlign: 'unset',
39
- // Makes it possible to ellipsize the text if it's too long.
40
- maxWidth: '100%',
41
- // Make the arrow visible when focused using the keyboard to assist
42
- // with a11y.
43
- '&:focus-visible': {
44
- [`& .${tableSortLabelClasses.icon}`]: {
45
- opacity: isActive ? 1 : 0.5
46
- }
60
+ let t2;
61
+ if ($[9] !== direction || $[10] !== headerText || $[11] !== isActive || $[12] !== onSort || $[13] !== showSortLabel) {
62
+ t2 = showSortLabel ? /*#__PURE__*/ _jsx(TableSortLabel, {
63
+ onClick: onSort,
64
+ direction: direction,
65
+ active: isActive,
66
+ sx: {
67
+ verticalAlign: "unset",
68
+ maxWidth: "100%",
69
+ "&:focus-visible": {
70
+ [`& .${tableSortLabelClasses.icon}`]: {
71
+ opacity: isActive ? 1 : 0.5
47
72
  }
48
- },
49
- children: headerText
50
- }) : headerText,
51
- resizeConfig && /*#__PURE__*/ _jsx(Box, {
52
- onMouseDown: (e)=>{
53
- if (e.detail === 2) {
54
- resizeConfig.resetSizeHandler();
55
- return;
56
- }
57
- resizeConfig.resizeHandler(e);
58
- },
59
- onTouchStart: resizeConfig.resizeHandler,
60
- sx: {
61
- position: 'absolute',
62
- height: '100%',
63
- top: 0,
64
- right: '4px',
65
- cursor: 'col-resize'
66
- },
67
- children: /*#__PURE__*/ _jsx(Divider, {
68
- flexItem: true,
69
- orientation: "vertical",
70
- sx: (theme)=>({
71
- backgroundColor: resizeConfig.isResizing ? theme.palette.action.active : theme.palette.divider,
72
- borderRadius: '2px',
73
- borderWidth: '2px',
74
- height: '100%',
75
- touchAction: 'none',
76
- transform: 'translateX(4px)',
77
- userSelect: 'none'
78
- })
79
- })
73
+ }
74
+ },
75
+ children: headerText
76
+ }) : headerText;
77
+ $[9] = direction;
78
+ $[10] = headerText;
79
+ $[11] = isActive;
80
+ $[12] = onSort;
81
+ $[13] = showSortLabel;
82
+ $[14] = t2;
83
+ } else {
84
+ t2 = $[14];
85
+ }
86
+ let t3;
87
+ if ($[15] !== resizeConfig) {
88
+ t3 = resizeConfig && /*#__PURE__*/ _jsx(Box, {
89
+ onMouseDown: (e)=>{
90
+ if (e.detail === 2) {
91
+ resizeConfig.resetSizeHandler();
92
+ return;
93
+ }
94
+ resizeConfig.resizeHandler(e);
95
+ },
96
+ onTouchStart: resizeConfig.resizeHandler,
97
+ sx: {
98
+ position: "absolute",
99
+ height: "100%",
100
+ top: 0,
101
+ right: "4px",
102
+ cursor: "col-resize"
103
+ },
104
+ children: /*#__PURE__*/ _jsx(Divider, {
105
+ flexItem: true,
106
+ orientation: "vertical",
107
+ sx: (theme)=>({
108
+ backgroundColor: resizeConfig.isResizing ? theme.palette.action.active : theme.palette.divider,
109
+ borderRadius: "2px",
110
+ borderWidth: "2px",
111
+ height: "100%",
112
+ touchAction: "none",
113
+ transform: "translateX(4px)",
114
+ userSelect: "none"
115
+ })
80
116
  })
81
- ]
82
- });
117
+ });
118
+ $[15] = resizeConfig;
119
+ $[16] = t3;
120
+ } else {
121
+ t3 = $[16];
122
+ }
123
+ let t4;
124
+ if ($[17] !== cellProps || $[18] !== t2 || $[19] !== t3) {
125
+ t4 = /*#__PURE__*/ _jsxs(TableCell, {
126
+ ...cellProps,
127
+ children: [
128
+ t2,
129
+ t3
130
+ ]
131
+ });
132
+ $[17] = cellProps;
133
+ $[18] = t2;
134
+ $[19] = t3;
135
+ $[20] = t4;
136
+ } else {
137
+ t4 = $[20];
138
+ }
139
+ return t4;
83
140
  }
84
141
 
85
142
  //# sourceMappingURL=TableHeaderCell.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/TableHeaderCell.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TableSortLabel, Typography, tableSortLabelClasses, Box, Divider } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport type { SortDirection } from './model/table-model';\nimport type { TableCellProps } from './TableCell';\nimport { TableCell } from './TableCell';\n\nexport interface TableHeaderCellProps extends TableCellProps {\n /**\n * Handler called when a sort event is triggered.\n * When specified, the header will include sorting interactions and indicators.\n */\n onSort?: ((event: unknown) => void) | undefined;\n\n /**\n * The current direction the header is sorted.\n */\n sortDirection?: SortDirection;\n\n /**\n * The next direction the header will be sorted when another sort action\n * is triggered via click/keyboard. This impacts some UI interactions (e.g.\n * the direction of the sort arrow on hover f the column is currently\n * unsorted.)\n */\n nextSortDirection?: SortDirection;\n\n /**\n * Configuration for column resizing interactions.\n * When included, the header will include a resize handle (divider).\n */\n resizeConfig?: ResizeConfig;\n}\n\nexport interface ResizeConfig {\n /**\n * Handler called when a column resize event is triggered.\n */\n resizeHandler: (event: unknown) => void;\n /**\n * Handler called when a column reset size event is triggered (double-click on the resize handle).\n */\n resetSizeHandler: () => void;\n\n /**\n * Indicates whether the column is currently being resized.\n */\n isResizing: boolean;\n}\n\nexport function TableHeaderCell({\n onSort,\n sortDirection,\n nextSortDirection,\n children,\n resizeConfig,\n ...cellProps\n}: TableHeaderCellProps): ReactElement {\n const showSortLabel = !!onSort;\n\n const headerText = (\n <Typography noWrap variant=\"inherit\" component=\"div\" color=\"inherit\">\n {children}\n </Typography>\n );\n\n const isActive = !!sortDirection;\n const direction = isActive ? sortDirection : nextSortDirection;\n\n return (\n <TableCell {...cellProps}>\n {showSortLabel ? (\n <TableSortLabel\n onClick={onSort}\n direction={direction}\n active={isActive}\n sx={{\n // Overrides a default vertical alignment in the CSS that changes\n // the header vertical rhythm in a way that's inconsistent with\n // non-sorting headers.\n verticalAlign: 'unset',\n\n // Makes it possible to ellipsize the text if it's too long.\n maxWidth: '100%',\n\n // Make the arrow visible when focused using the keyboard to assist\n // with a11y.\n '&:focus-visible': {\n [`& .${tableSortLabelClasses.icon}`]: {\n opacity: isActive ? 1 : 0.5,\n },\n },\n }}\n >\n {headerText}\n </TableSortLabel>\n ) : (\n headerText\n )}\n {resizeConfig && (\n <Box\n onMouseDown={(e) => {\n if (e.detail === 2) {\n resizeConfig.resetSizeHandler();\n return;\n }\n resizeConfig.resizeHandler(e);\n }}\n onTouchStart={resizeConfig.resizeHandler}\n sx={{\n position: 'absolute',\n height: '100%',\n top: 0,\n right: '4px',\n cursor: 'col-resize',\n }}\n >\n <Divider\n flexItem\n orientation=\"vertical\"\n sx={(theme) => ({\n backgroundColor: resizeConfig.isResizing ? theme.palette.action.active : theme.palette.divider,\n borderRadius: '2px',\n borderWidth: '2px',\n height: '100%',\n touchAction: 'none',\n transform: 'translateX(4px)',\n userSelect: 'none',\n })}\n />\n </Box>\n )}\n </TableCell>\n );\n}\n"],"names":["TableSortLabel","Typography","tableSortLabelClasses","Box","Divider","TableCell","TableHeaderCell","onSort","sortDirection","nextSortDirection","children","resizeConfig","cellProps","showSortLabel","headerText","noWrap","variant","component","color","isActive","direction","onClick","active","sx","verticalAlign","maxWidth","icon","opacity","onMouseDown","e","detail","resetSizeHandler","resizeHandler","onTouchStart","position","height","top","right","cursor","flexItem","orientation","theme","backgroundColor","isResizing","palette","action","divider","borderRadius","borderWidth","touchAction","transform","userSelect"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,cAAc,EAAEC,UAAU,EAAEC,qBAAqB,EAAEC,GAAG,EAAEC,OAAO,QAAQ,gBAAgB;AAKhG,SAASC,SAAS,QAAQ,iBAAc;AA6CxC,OAAO,SAASC,gBAAgB,EAC9BC,MAAM,EACNC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACRC,YAAY,EACZ,GAAGC,WACkB;IACrB,MAAMC,gBAAgB,CAAC,CAACN;IAExB,MAAMO,2BACJ,KAACb;QAAWc,MAAM;QAACC,SAAQ;QAAUC,WAAU;QAAMC,OAAM;kBACxDR;;IAIL,MAAMS,WAAW,CAAC,CAACX;IACnB,MAAMY,YAAYD,WAAWX,gBAAgBC;IAE7C,qBACE,MAACJ;QAAW,GAAGO,SAAS;;YACrBC,8BACC,KAACb;gBACCqB,SAASd;gBACTa,WAAWA;gBACXE,QAAQH;gBACRI,IAAI;oBACF,iEAAiE;oBACjE,+DAA+D;oBAC/D,uBAAuB;oBACvBC,eAAe;oBAEf,4DAA4D;oBAC5DC,UAAU;oBAEV,mEAAmE;oBACnE,aAAa;oBACb,mBAAmB;wBACjB,CAAC,CAAC,GAAG,EAAEvB,sBAAsBwB,IAAI,EAAE,CAAC,EAAE;4BACpCC,SAASR,WAAW,IAAI;wBAC1B;oBACF;gBACF;0BAECL;iBAGHA;YAEDH,8BACC,KAACR;gBACCyB,aAAa,CAACC;oBACZ,IAAIA,EAAEC,MAAM,KAAK,GAAG;wBAClBnB,aAAaoB,gBAAgB;wBAC7B;oBACF;oBACApB,aAAaqB,aAAa,CAACH;gBAC7B;gBACAI,cAActB,aAAaqB,aAAa;gBACxCT,IAAI;oBACFW,UAAU;oBACVC,QAAQ;oBACRC,KAAK;oBACLC,OAAO;oBACPC,QAAQ;gBACV;0BAEA,cAAA,KAAClC;oBACCmC,QAAQ;oBACRC,aAAY;oBACZjB,IAAI,CAACkB,QAAW,CAAA;4BACdC,iBAAiB/B,aAAagC,UAAU,GAAGF,MAAMG,OAAO,CAACC,MAAM,CAACvB,MAAM,GAAGmB,MAAMG,OAAO,CAACE,OAAO;4BAC9FC,cAAc;4BACdC,aAAa;4BACbb,QAAQ;4BACRc,aAAa;4BACbC,WAAW;4BACXC,YAAY;wBACd,CAAA;;;;;AAMZ"}
1
+ {"version":3,"sources":["../../src/Table/TableHeaderCell.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TableSortLabel, Typography, tableSortLabelClasses, Box, Divider } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport type { SortDirection } from './model/table-model';\nimport type { TableCellProps } from './TableCell';\nimport { TableCell } from './TableCell';\n\nexport interface TableHeaderCellProps extends TableCellProps {\n /**\n * Handler called when a sort event is triggered.\n * When specified, the header will include sorting interactions and indicators.\n */\n onSort?: ((event: unknown) => void) | undefined;\n\n /**\n * The current direction the header is sorted.\n */\n sortDirection?: SortDirection;\n\n /**\n * The next direction the header will be sorted when another sort action\n * is triggered via click/keyboard. This impacts some UI interactions (e.g.\n * the direction of the sort arrow on hover f the column is currently\n * unsorted.)\n */\n nextSortDirection?: SortDirection;\n\n /**\n * Configuration for column resizing interactions.\n * When included, the header will include a resize handle (divider).\n */\n resizeConfig?: ResizeConfig;\n}\n\nexport interface ResizeConfig {\n /**\n * Handler called when a column resize event is triggered.\n */\n resizeHandler: (event: unknown) => void;\n /**\n * Handler called when a column reset size event is triggered (double-click on the resize handle).\n */\n resetSizeHandler: () => void;\n\n /**\n * Indicates whether the column is currently being resized.\n */\n isResizing: boolean;\n}\n\nexport function TableHeaderCell({\n onSort,\n sortDirection,\n nextSortDirection,\n children,\n resizeConfig,\n ...cellProps\n}: TableHeaderCellProps): ReactElement {\n const showSortLabel = !!onSort;\n\n const headerText = (\n <Typography noWrap variant=\"inherit\" component=\"div\" color=\"inherit\">\n {children}\n </Typography>\n );\n\n const isActive = !!sortDirection;\n const direction = isActive ? sortDirection : nextSortDirection;\n\n return (\n <TableCell {...cellProps}>\n {showSortLabel ? (\n <TableSortLabel\n onClick={onSort}\n direction={direction}\n active={isActive}\n sx={{\n // Overrides a default vertical alignment in the CSS that changes\n // the header vertical rhythm in a way that's inconsistent with\n // non-sorting headers.\n verticalAlign: 'unset',\n\n // Makes it possible to ellipsize the text if it's too long.\n maxWidth: '100%',\n\n // Make the arrow visible when focused using the keyboard to assist\n // with a11y.\n '&:focus-visible': {\n [`& .${tableSortLabelClasses.icon}`]: {\n opacity: isActive ? 1 : 0.5,\n },\n },\n }}\n >\n {headerText}\n </TableSortLabel>\n ) : (\n headerText\n )}\n {resizeConfig && (\n <Box\n onMouseDown={(e) => {\n if (e.detail === 2) {\n resizeConfig.resetSizeHandler();\n return;\n }\n resizeConfig.resizeHandler(e);\n }}\n onTouchStart={resizeConfig.resizeHandler}\n sx={{\n position: 'absolute',\n height: '100%',\n top: 0,\n right: '4px',\n cursor: 'col-resize',\n }}\n >\n <Divider\n flexItem\n orientation=\"vertical\"\n sx={(theme) => ({\n backgroundColor: resizeConfig.isResizing ? theme.palette.action.active : theme.palette.divider,\n borderRadius: '2px',\n borderWidth: '2px',\n height: '100%',\n touchAction: 'none',\n transform: 'translateX(4px)',\n userSelect: 'none',\n })}\n />\n </Box>\n )}\n </TableCell>\n );\n}\n"],"names":["TableSortLabel","Typography","tableSortLabelClasses","Box","Divider","TableCell"],"mappings":";;AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,cAAc,EAAEC,UAAU,EAAEC,qBAAqB,EAAEC,GAAG,EAAEC,OAAO,QAAQ,gBAAgB;AAKhG,SAASC,SAAS,QAAQ,iBAAc;AA6CxC,OAAO"}
@@ -11,19 +11,43 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { c as _c } from "react-compiler-runtime";
14
15
  import { TableRow as MuiTableRow, alpha } from "@mui/material";
15
16
  import { forwardRef } from "react";
16
17
  export const TableRow = /*#__PURE__*/ forwardRef(function TableRow(props, ref) {
17
- return /*#__PURE__*/ _jsx(MuiTableRow, {
18
- ...props,
19
- ref: ref,
20
- sx: {
21
- backgroundColor: (theme)=>theme.palette.background.default,
22
- '&:hover': {
23
- backgroundColor: (theme)=>alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity)
18
+ const $ = _c(4);
19
+ let t0;
20
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
21
+ t0 = {
22
+ backgroundColor: _temp,
23
+ "&:hover": {
24
+ backgroundColor: _temp2
24
25
  }
25
- }
26
- });
26
+ };
27
+ $[0] = t0;
28
+ } else {
29
+ t0 = $[0];
30
+ }
31
+ let t1;
32
+ if ($[1] !== props || $[2] !== ref) {
33
+ t1 = /*#__PURE__*/ _jsx(MuiTableRow, {
34
+ ...props,
35
+ ref: ref,
36
+ sx: t0
37
+ });
38
+ $[1] = props;
39
+ $[2] = ref;
40
+ $[3] = t1;
41
+ } else {
42
+ t1 = $[3];
43
+ }
44
+ return t1;
27
45
  });
46
+ function _temp(theme) {
47
+ return theme.palette.background.default;
48
+ }
49
+ function _temp2(theme_0) {
50
+ return alpha(theme_0.palette.primary.main, theme_0.palette.action.hoverOpacity);
51
+ }
28
52
 
29
53
  //# sourceMappingURL=TableRow.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/TableRow.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { TableRowProps as MuiTableRowProps } from '@mui/material';\nimport { TableRow as MuiTableRow, alpha } from '@mui/material';\nimport { forwardRef } from 'react';\n\nimport type { TableDensity } from './model/table-model';\n\ninterface TableRowProps extends MuiTableRowProps<'div'> {\n density: TableDensity;\n}\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow(props, ref) {\n return (\n <MuiTableRow\n {...props}\n ref={ref}\n sx={{\n backgroundColor: (theme) => theme.palette.background.default,\n '&:hover': {\n backgroundColor: (theme) => alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity),\n },\n }}\n />\n );\n});\n"],"names":["TableRow","MuiTableRow","alpha","forwardRef","props","ref","sx","backgroundColor","theme","palette","background","default","primary","main","action","hoverOpacity"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,YAAYC,WAAW,EAAEC,KAAK,QAAQ,gBAAgB;AAC/D,SAASC,UAAU,QAAQ,QAAQ;AAQnC,OAAO,MAAMH,yBAAWG,WAA+C,SAASH,SAASI,KAAK,EAAEC,GAAG;IACjG,qBACE,KAACJ;QACE,GAAGG,KAAK;QACTC,KAAKA;QACLC,IAAI;YACFC,iBAAiB,CAACC,QAAUA,MAAMC,OAAO,CAACC,UAAU,CAACC,OAAO;YAC5D,WAAW;gBACTJ,iBAAiB,CAACC,QAAUN,MAAMM,MAAMC,OAAO,CAACG,OAAO,CAACC,IAAI,EAAEL,MAAMC,OAAO,CAACK,MAAM,CAACC,YAAY;YACjG;QACF;;AAGN,GAAG"}
1
+ {"version":3,"sources":["../../src/Table/TableRow.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { TableRowProps as MuiTableRowProps } from '@mui/material';\nimport { TableRow as MuiTableRow, alpha } from '@mui/material';\nimport { forwardRef } from 'react';\n\nimport type { TableDensity } from './model/table-model';\n\ninterface TableRowProps extends MuiTableRowProps<'div'> {\n density: TableDensity;\n}\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow(props, ref) {\n return (\n <MuiTableRow\n {...props}\n ref={ref}\n sx={{\n backgroundColor: (theme) => theme.palette.background.default,\n '&:hover': {\n backgroundColor: (theme) => alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity),\n },\n }}\n />\n );\n});\n"],"names":["TableRow","MuiTableRow","alpha","forwardRef"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAGjC,SAASA,YAAYC,WAAW,EAAEC,KAAK,QAAQ,gBAAgB;AAC/D,SAASC,UAAU,QAAQ,QAAQ;AAQnC,OAAO,MAAMH,yBAAWG,WAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAapE"}
@@ -1,6 +1,7 @@
1
- import type { Column } from '@tanstack/react-table';
1
+ import type { Column, RowData } from '@tanstack/react-table';
2
2
  import type { ReactElement } from 'react';
3
- export interface TableToolbarProps<TableData> {
3
+ import type { TableFeatures } from './model/table-model';
4
+ export interface TableToolbarProps<TableData extends RowData> {
4
5
  /**
5
6
  * When `true`, a search input is rendered.
6
7
  */
@@ -20,7 +21,7 @@ export interface TableToolbarProps<TableData> {
20
21
  /**
21
22
  * All columns from the table instance, used to build the visibility menu.
22
23
  */
23
- columns: Array<Column<TableData>>;
24
+ columns: Array<Column<TableFeatures, TableData>>;
24
25
  /**
25
26
  * The width of the toolbar, used to determine when to switch to a more compact layout.
26
27
  */
@@ -42,5 +43,5 @@ export interface TableToolbarProps<TableData> {
42
43
  */
43
44
  onExpandAllChange?: (event: unknown) => void;
44
45
  }
45
- export declare function TableToolbar<TableData>({ isSearchEnabled, globalFilter, onGlobalFilterChange, isColumnFilterEnabled, columns, width, columnFilterMenuMaxHeight, isExpandAllEnabled, isAllExpanded, onExpandAllChange, }: TableToolbarProps<TableData>): ReactElement | null;
46
+ export declare function TableToolbar<TableData extends RowData>({ isSearchEnabled, globalFilter, onGlobalFilterChange, isColumnFilterEnabled, columns, width, columnFilterMenuMaxHeight, isExpandAllEnabled, isAllExpanded, onExpandAllChange, }: TableToolbarProps<TableData>): ReactElement | null;
46
47
  //# sourceMappingURL=TableToolbar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableToolbar.d.ts","sourceRoot":"","sources":["../../src/Table/TableToolbar.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAMpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,MAAM,WAAW,iBAAiB,CAAC,SAAS;IAC1C;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9C;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvB;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5C;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,EACtC,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,OAAO,EACP,KAAK,EACL,yBAA+B,EAC/B,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GAClB,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG,YAAY,GAAG,IAAI,CA2GpD"}
1
+ {"version":3,"file":"TableToolbar.d.ts","sourceRoot":"","sources":["../../src/Table/TableToolbar.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAO7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,iBAAiB,CAAC,SAAS,SAAS,OAAO;IAC1D;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9C;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;IACjD;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvB;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5C;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,wBAAgB,YAAY,CAAC,SAAS,SAAS,OAAO,EAAE,EACtD,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,OAAO,EACP,KAAK,EACL,yBAA+B,EAC/B,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GAClB,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG,YAAY,GAAG,IAAI,CA8GpD"}