@perses-dev/components 0.54.0-beta.1 → 0.54.0-beta.3

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 (216) hide show
  1. package/dist/AlignSelector/AlignSelector.js +1 -1
  2. package/dist/AlignSelector/AlignSelector.js.map +1 -1
  3. package/dist/ColorPicker/ColorPicker.js +1 -1
  4. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  5. package/dist/ColorPicker/OptionsColorPicker.js +1 -1
  6. package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
  7. package/dist/ContentWithLegend/model/content-with-legend-model.d.ts.map +1 -1
  8. package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
  9. package/dist/Dialog/DiscardChangesConfirmationDialog.js +1 -1
  10. package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
  11. package/dist/DragAndDrop/DragAndDropList.js +1 -1
  12. package/dist/DragAndDrop/DragAndDropList.js.map +1 -1
  13. package/dist/DragAndDrop/DragButton.js +1 -1
  14. package/dist/DragAndDrop/DragButton.js.map +1 -1
  15. package/dist/DragAndDrop/DropIndicator.js +1 -1
  16. package/dist/DragAndDrop/DropIndicator.js.map +1 -1
  17. package/dist/Drawer/Drawer.js +1 -1
  18. package/dist/Drawer/Drawer.js.map +1 -1
  19. package/dist/EChart/EChart.js +1 -1
  20. package/dist/EChart/EChart.js.map +1 -1
  21. package/dist/ErrorAlert.js +1 -1
  22. package/dist/ErrorAlert.js.map +1 -1
  23. package/dist/FormEditor/FormActions.js +1 -1
  24. package/dist/FormEditor/FormActions.js.map +1 -1
  25. package/dist/FormatControls/FormatControls.js +1 -1
  26. package/dist/FormatControls/FormatControls.js.map +1 -1
  27. package/dist/JSONEditor.js +1 -1
  28. package/dist/JSONEditor.js.map +1 -1
  29. package/dist/Legend/CompactLegend.js +1 -1
  30. package/dist/Legend/CompactLegend.js.map +1 -1
  31. package/dist/Legend/Legend.js +1 -1
  32. package/dist/Legend/Legend.js.map +1 -1
  33. package/dist/Legend/LegendColorBadge.js +1 -1
  34. package/dist/Legend/LegendColorBadge.js.map +1 -1
  35. package/dist/Legend/ListLegend.js +1 -1
  36. package/dist/Legend/ListLegend.js.map +1 -1
  37. package/dist/Legend/ListLegendItem.js +1 -1
  38. package/dist/Legend/ListLegendItem.js.map +1 -1
  39. package/dist/Legend/TableLegend.d.ts.map +1 -1
  40. package/dist/Legend/TableLegend.js +18 -4
  41. package/dist/Legend/TableLegend.js.map +1 -1
  42. package/dist/LinksEditor/LinkEditorForm.js +1 -1
  43. package/dist/LinksEditor/LinkEditorForm.js.map +1 -1
  44. package/dist/LinksEditor/LinksEditor.js +1 -1
  45. package/dist/LinksEditor/LinksEditor.js.map +1 -1
  46. package/dist/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
  47. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
  48. package/dist/OptionsEditorLayout/OptionsEditorControl.js +1 -1
  49. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  50. package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
  51. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
  52. package/dist/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
  53. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  54. package/dist/Overlay/Overlay.js +1 -1
  55. package/dist/Overlay/Overlay.js.map +1 -1
  56. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +1 -1
  57. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  58. package/dist/SettingsAutocomplete/SettingsAutocomplete.js +1 -1
  59. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  60. package/dist/SortSelector/SortSelectorButtons.js +1 -1
  61. package/dist/SortSelector/SortSelectorButtons.js.map +1 -1
  62. package/dist/Table/InnerTable.js +1 -1
  63. package/dist/Table/InnerTable.js.map +1 -1
  64. package/dist/Table/Table.d.ts +1 -1
  65. package/dist/Table/Table.d.ts.map +1 -1
  66. package/dist/Table/Table.js +25 -12
  67. package/dist/Table/Table.js.map +1 -1
  68. package/dist/Table/TableBody.js +1 -1
  69. package/dist/Table/TableBody.js.map +1 -1
  70. package/dist/Table/TableCell.js +1 -1
  71. package/dist/Table/TableCell.js.map +1 -1
  72. package/dist/Table/TableCheckbox.js +1 -1
  73. package/dist/Table/TableCheckbox.js.map +1 -1
  74. package/dist/Table/TableFoot.js +1 -1
  75. package/dist/Table/TableFoot.js.map +1 -1
  76. package/dist/Table/TableHead.js +1 -1
  77. package/dist/Table/TableHead.js.map +1 -1
  78. package/dist/Table/TableHeaderCell.d.ts +20 -1
  79. package/dist/Table/TableHeaderCell.d.ts.map +1 -1
  80. package/dist/Table/TableHeaderCell.js +56 -24
  81. package/dist/Table/TableHeaderCell.js.map +1 -1
  82. package/dist/Table/TableRow.js +1 -1
  83. package/dist/Table/TableRow.js.map +1 -1
  84. package/dist/Table/TableToolbar.d.ts +13 -1
  85. package/dist/Table/TableToolbar.d.ts.map +1 -1
  86. package/dist/Table/TableToolbar.js +15 -4
  87. package/dist/Table/TableToolbar.js.map +1 -1
  88. package/dist/Table/VirtualizedTable.d.ts +6 -4
  89. package/dist/Table/VirtualizedTable.d.ts.map +1 -1
  90. package/dist/Table/VirtualizedTable.js +151 -128
  91. package/dist/Table/VirtualizedTable.js.map +1 -1
  92. package/dist/Table/VirtualizedTableContainer.js +1 -1
  93. package/dist/Table/VirtualizedTableContainer.js.map +1 -1
  94. package/dist/Table/hooks/useFuzzySearch.d.ts +5 -3
  95. package/dist/Table/hooks/useFuzzySearch.d.ts.map +1 -1
  96. package/dist/Table/hooks/useFuzzySearch.js +32 -13
  97. package/dist/Table/hooks/useFuzzySearch.js.map +1 -1
  98. package/dist/Table/model/table-model.d.ts +42 -2
  99. package/dist/Table/model/table-model.d.ts.map +1 -1
  100. package/dist/Table/model/table-model.js +37 -19
  101. package/dist/Table/model/table-model.js.map +1 -1
  102. package/dist/ThresholdsEditor/ThresholdInput.js +1 -1
  103. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  104. package/dist/ThresholdsEditor/ThresholdsEditor.js +1 -1
  105. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  106. package/dist/TimeRangeSelector/DateTimeRangePicker.js +1 -1
  107. package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
  108. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -1
  109. package/dist/TimeRangeSelector/TimeRangeSelector.js +25 -2
  110. package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
  111. package/dist/TimeSeriesTooltip/SeriesInfo.js +1 -1
  112. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  113. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +1 -1
  114. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  115. package/dist/TimeSeriesTooltip/SeriesMarker.js +1 -1
  116. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
  117. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +1 -1
  118. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  119. package/dist/TimeSeriesTooltip/TooltipContent.js +1 -1
  120. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
  121. package/dist/TimeSeriesTooltip/TooltipHeader.js +1 -1
  122. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  123. package/dist/TimeZoneSelector.js +1 -1
  124. package/dist/TimeZoneSelector.js.map +1 -1
  125. package/dist/ToolbarIconButton/ToolbarIconButton.js +1 -1
  126. package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
  127. package/dist/TransformsEditor/TransformEditor.js +1 -1
  128. package/dist/TransformsEditor/TransformEditor.js.map +1 -1
  129. package/dist/TransformsEditor/TransformEditorContainer.js +1 -1
  130. package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
  131. package/dist/TransformsEditor/TransformsEditor.js +1 -1
  132. package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
  133. package/dist/ValueMappingEditor/ValueMappingEditor.d.ts +1 -1
  134. package/dist/ValueMappingEditor/ValueMappingEditor.d.ts.map +1 -1
  135. package/dist/ValueMappingEditor/ValueMappingEditor.js +1 -1
  136. package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -1
  137. package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts +1 -1
  138. package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts.map +1 -1
  139. package/dist/ValueMappingEditor/ValueMappingsEditor.js +1 -1
  140. package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -1
  141. package/dist/YAxisLabel.js +1 -1
  142. package/dist/YAxisLabel.js.map +1 -1
  143. package/dist/cjs/Legend/TableLegend.js +16 -2
  144. package/dist/cjs/Table/Table.js +24 -11
  145. package/dist/cjs/Table/TableHeaderCell.js +54 -22
  146. package/dist/cjs/Table/TableToolbar.js +13 -2
  147. package/dist/cjs/Table/VirtualizedTable.js +150 -127
  148. package/dist/cjs/Table/hooks/useFuzzySearch.js +30 -11
  149. package/dist/cjs/Table/model/table-model.js +43 -19
  150. package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +23 -0
  151. package/dist/cjs/model/index.js +1 -0
  152. package/dist/cjs/model/value-mapping.js +16 -0
  153. package/dist/cjs/theme/typography.js +1 -1
  154. package/dist/cjs/utils/format.js +20 -0
  155. package/dist/cjs/utils/index.js +4 -0
  156. package/dist/cjs/utils/mathjs.js +14 -3
  157. package/dist/cjs/utils/regexp.js +54 -0
  158. package/dist/cjs/utils/time-series-data.js +141 -0
  159. package/dist/cjs/utils/transform-data.js +157 -0
  160. package/dist/cjs/utils/value-mapping.js +105 -0
  161. package/dist/context/ChartsProvider.js +1 -1
  162. package/dist/context/ChartsProvider.js.map +1 -1
  163. package/dist/context/ItemActionsProvider.js +1 -1
  164. package/dist/context/ItemActionsProvider.js.map +1 -1
  165. package/dist/context/SelectionProvider.js +1 -1
  166. package/dist/context/SelectionProvider.js.map +1 -1
  167. package/dist/context/SnackbarProvider.js +1 -1
  168. package/dist/context/SnackbarProvider.js.map +1 -1
  169. package/dist/context/TimeZoneProvider.js +1 -1
  170. package/dist/context/TimeZoneProvider.js.map +1 -1
  171. package/dist/controls/TextField.js +1 -1
  172. package/dist/controls/TextField.js.map +1 -1
  173. package/dist/model/index.d.ts +1 -0
  174. package/dist/model/index.d.ts.map +1 -1
  175. package/dist/model/index.js +1 -0
  176. package/dist/model/index.js.map +1 -1
  177. package/dist/model/value-mapping.d.ts +35 -0
  178. package/dist/model/value-mapping.d.ts.map +1 -0
  179. package/dist/model/value-mapping.js +15 -0
  180. package/dist/model/value-mapping.js.map +1 -0
  181. package/dist/test/render.js +1 -1
  182. package/dist/test/render.js.map +1 -1
  183. package/dist/theme/typography.js +1 -1
  184. package/dist/theme/typography.js.map +1 -1
  185. package/dist/utils/format.d.ts +1 -0
  186. package/dist/utils/format.d.ts.map +1 -1
  187. package/dist/utils/format.js +17 -0
  188. package/dist/utils/format.js.map +1 -1
  189. package/dist/utils/index.d.ts +4 -0
  190. package/dist/utils/index.d.ts.map +1 -1
  191. package/dist/utils/index.js +4 -0
  192. package/dist/utils/index.js.map +1 -1
  193. package/dist/utils/mathjs.d.ts +8 -1
  194. package/dist/utils/mathjs.d.ts.map +1 -1
  195. package/dist/utils/mathjs.js +5 -2
  196. package/dist/utils/mathjs.js.map +1 -1
  197. package/dist/utils/regexp.d.ts +11 -0
  198. package/dist/utils/regexp.d.ts.map +1 -0
  199. package/dist/utils/regexp.js +42 -0
  200. package/dist/utils/regexp.js.map +1 -0
  201. package/dist/utils/request-interpolation.d.ts +1 -1
  202. package/dist/utils/request-interpolation.d.ts.map +1 -1
  203. package/dist/utils/request-interpolation.js.map +1 -1
  204. package/dist/utils/time-series-data.d.ts +15 -0
  205. package/dist/utils/time-series-data.d.ts.map +1 -0
  206. package/dist/utils/time-series-data.js +130 -0
  207. package/dist/utils/time-series-data.js.map +1 -0
  208. package/dist/utils/transform-data.d.ts +7 -0
  209. package/dist/utils/transform-data.d.ts.map +1 -0
  210. package/dist/utils/transform-data.js +214 -0
  211. package/dist/utils/transform-data.js.map +1 -0
  212. package/dist/utils/value-mapping.d.ts +3 -0
  213. package/dist/utils/value-mapping.d.ts.map +1 -0
  214. package/dist/utils/value-mapping.js +97 -0
  215. package/dist/utils/value-mapping.js.map +1 -0
  216. package/package.json +3 -2
@@ -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 { TableHead as MuiTableHead, TableHeadProps as MuiTableHeadProps } 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;;AAEjC,SAASA,aAAaC,YAAY,QAA6C,gBAAgB;AAC/F,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 { TableHead as MuiTableHead, TableHeadProps as MuiTableHeadProps } 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;AAEjC,SAASA,aAAaC,YAAY,QAA6C,gBAAgB;AAC/F,SAASC,UAAU,QAAQ,QAAQ;AAInC,OAAO,MAAMF,0BAAYE,WAAoD,SAASF,UAAUG,KAAK,EAAEC,GAAG;IACxG,qBAAO,KAACH;QAAc,GAAGE,KAAK;QAAEC,KAAKA;;AACvC,GAAG"}
@@ -18,6 +18,25 @@ export interface TableHeaderCellProps extends TableCellProps {
18
18
  * unsorted.)
19
19
  */
20
20
  nextSortDirection?: SortDirection;
21
+ /**
22
+ * Configuration for column resizing interactions.
23
+ * When included, the header will include a resize handle (divider).
24
+ */
25
+ resizeConfig?: ResizeConfig;
26
+ }
27
+ export interface ResizeConfig {
28
+ /**
29
+ * Handler called when a column resize event is triggered.
30
+ */
31
+ resizeHandler: (event: unknown) => void;
32
+ /**
33
+ * Handler called when a column reset size event is triggered (double-click on the resize handle).
34
+ */
35
+ resetSizeHandler: () => void;
36
+ /**
37
+ * Indicates whether the column is currently being resized.
38
+ */
39
+ isResizing: boolean;
21
40
  }
22
- export declare function TableHeaderCell({ onSort, sortDirection, nextSortDirection, children, ...cellProps }: TableHeaderCellProps): ReactElement;
41
+ export declare function TableHeaderCell({ onSort, sortDirection, nextSortDirection, children, resizeConfig, ...cellProps }: TableHeaderCellProps): ReactElement;
23
42
  //# sourceMappingURL=TableHeaderCell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeaderCell.d.ts","sourceRoot":"","sources":["../../src/Table/TableHeaderCell.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAa,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAEhD;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,aAAa,CAAC;CACnC;AAED,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,oBAAoB,GAAG,YAAY,CA4CrC"}
1
+ {"version":3,"file":"TableHeaderCell.d.ts","sourceRoot":"","sources":["../../src/Table/TableHeaderCell.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAa,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAEhD;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,aAAa,CAAC;IAElC;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC;;OAEG;IACH,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAE7B;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,oBAAoB,GAAG,YAAY,CA6ErC"}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  // Copyright The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
@@ -10,10 +11,9 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { TableSortLabel, Typography, tableSortLabelClasses } from '@mui/material';
14
+ import { TableSortLabel, Typography, tableSortLabelClasses, Box, Divider } from '@mui/material';
15
15
  import { TableCell } from './TableCell';
16
- export function TableHeaderCell({ onSort, sortDirection, nextSortDirection, children, ...cellProps }) {
16
+ export function TableHeaderCell({ onSort, sortDirection, nextSortDirection, children, resizeConfig, ...cellProps }) {
17
17
  const showSortLabel = !!onSort;
18
18
  const headerText = /*#__PURE__*/ _jsx(Typography, {
19
19
  noWrap: true,
@@ -24,29 +24,61 @@ export function TableHeaderCell({ onSort, sortDirection, nextSortDirection, chil
24
24
  });
25
25
  const isActive = !!sortDirection;
26
26
  const direction = isActive ? sortDirection : nextSortDirection;
27
- return /*#__PURE__*/ _jsx(TableCell, {
27
+ return /*#__PURE__*/ _jsxs(TableCell, {
28
28
  ...cellProps,
29
- children: showSortLabel ? /*#__PURE__*/ _jsx(TableSortLabel, {
30
- onClick: onSort,
31
- direction: direction,
32
- active: isActive,
33
- sx: {
34
- // Overrides a default vertical alignment in the CSS that changes
35
- // the header vertical rhythm in a way that's inconsistent with
36
- // non-sorting headers.
37
- verticalAlign: 'unset',
38
- // Makes it possible to ellipsize the text if it's too long.
39
- maxWidth: '100%',
40
- // Make the arrow visible when focused using the keyboard to assist
41
- // with a11y.
42
- '&:focus-visible': {
43
- [`& .${tableSortLabelClasses.icon}`]: {
44
- opacity: isActive ? 1 : 0.5
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
+ }
45
47
  }
46
- }
47
- },
48
- children: headerText
49
- }) : headerText
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
+ })
80
+ })
81
+ ]
50
82
  });
51
83
  }
52
84
 
@@ -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 } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { TableCell, TableCellProps } from './TableCell';\nimport { SortDirection } from './model/table-model';\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\nexport function TableHeaderCell({\n onSort,\n sortDirection,\n nextSortDirection,\n children,\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 </TableCell>\n );\n}\n"],"names":["TableSortLabel","Typography","tableSortLabelClasses","TableCell","TableHeaderCell","onSort","sortDirection","nextSortDirection","children","cellProps","showSortLabel","headerText","noWrap","variant","component","color","isActive","direction","onClick","active","sx","verticalAlign","maxWidth","icon","opacity"],"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,QAAQ,gBAAgB;AAElF,SAASC,SAAS,QAAwB,cAAc;AAwBxD,OAAO,SAASC,gBAAgB,EAC9BC,MAAM,EACNC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACR,GAAGC,WACkB;IACrB,MAAMC,gBAAgB,CAAC,CAACL;IAExB,MAAMM,2BACJ,KAACV;QAAWW,MAAM;QAACC,SAAQ;QAAUC,WAAU;QAAMC,OAAM;kBACxDP;;IAIL,MAAMQ,WAAW,CAAC,CAACV;IACnB,MAAMW,YAAYD,WAAWV,gBAAgBC;IAE7C,qBACE,KAACJ;QAAW,GAAGM,SAAS;kBACrBC,8BACC,KAACV;YACCkB,SAASb;YACTY,WAAWA;YACXE,QAAQH;YACRI,IAAI;gBACF,iEAAiE;gBACjE,+DAA+D;gBAC/D,uBAAuB;gBACvBC,eAAe;gBAEf,4DAA4D;gBAC5DC,UAAU;gBAEV,mEAAmE;gBACnE,aAAa;gBACb,mBAAmB;oBACjB,CAAC,CAAC,GAAG,EAAEpB,sBAAsBqB,IAAI,EAAE,CAAC,EAAE;wBACpCC,SAASR,WAAW,IAAI;oBAC1B;gBACF;YACF;sBAECL;aAGHA;;AAIR"}
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 { ReactElement } from 'react';\nimport { TableCell, TableCellProps } from './TableCell';\nimport { SortDirection } from './model/table-model';\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;AAEhG,SAASC,SAAS,QAAwB,cAAc;AA8CxD,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,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  // Copyright The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
@@ -10,7 +11,6 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { TableRow as MuiTableRow, alpha } from '@mui/material';
15
15
  import { forwardRef } from 'react';
16
16
  export const TableRow = /*#__PURE__*/ forwardRef(function TableRow(props, ref) {
@@ -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 { TableRow as MuiTableRow, TableRowProps as MuiTableRowProps, alpha } from '@mui/material';\nimport { forwardRef } from 'react';\nimport { 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;;AAEjC,SAASA,YAAYC,WAAW,EAAqCC,KAAK,QAAQ,gBAAgB;AAClG,SAASC,UAAU,QAAQ,QAAQ;AAOnC,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 { TableRow as MuiTableRow, TableRowProps as MuiTableRowProps, alpha } from '@mui/material';\nimport { forwardRef } from 'react';\nimport { 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;AAEjC,SAASA,YAAYC,WAAW,EAAqCC,KAAK,QAAQ,gBAAgB;AAClG,SAASC,UAAU,QAAQ,QAAQ;AAOnC,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"}
@@ -29,6 +29,18 @@ export interface TableToolbarProps<TableData> {
29
29
  * Max height for the column filter menu.
30
30
  */
31
31
  columnFilterMenuMaxHeight?: number | string;
32
+ /**
33
+ * When `true`, an "Expand All" / "Collapse All" toggle button is rendered.
34
+ */
35
+ isExpandAllEnabled?: boolean;
36
+ /**
37
+ * Whether all rows are currently expanded.
38
+ */
39
+ isAllExpanded?: boolean;
40
+ /**
41
+ * Callback to toggle expand/collapse all rows.
42
+ */
43
+ onExpandAllChange?: (event: unknown) => void;
32
44
  }
33
- export declare function TableToolbar<TableData>({ isSearchEnabled, globalFilter, onGlobalFilterChange, isColumnFilterEnabled, columns, width, columnFilterMenuMaxHeight, }: TableToolbarProps<TableData>): ReactElement | null;
45
+ export declare function TableToolbar<TableData>({ isSearchEnabled, globalFilter, onGlobalFilterChange, isColumnFilterEnabled, columns, width, columnFilterMenuMaxHeight, isExpandAllEnabled, isAllExpanded, onExpandAllChange, }: TableToolbarProps<TableData>): ReactElement | null;
34
46
  //# sourceMappingURL=TableToolbar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableToolbar.d.ts","sourceRoot":"","sources":["../../src/Table/TableToolbar.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAyB,MAAM,OAAO,CAAC;AAM5D,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;I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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,CAyGpD"}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  // Copyright The Perses Authors
2
3
  // Licensed under the Apache License, Version 2.0 (the "License");
3
4
  // you may not use this file except in compliance with the License.
@@ -10,14 +11,15 @@
10
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
12
  // See the License for the specific language governing permissions and
12
13
  // limitations under the License.
13
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
- import { Checkbox, IconButton, InputAdornment, ListItemText, Menu, MenuItem, Stack } from '@mui/material';
14
+ import { Checkbox, IconButton, InputAdornment, ListItemText, Menu, MenuItem, Stack, Tooltip } from '@mui/material';
15
15
  import { useCallback, useState } from 'react';
16
16
  import Magnify from 'mdi-material-ui/Magnify';
17
17
  import Close from 'mdi-material-ui/Close';
18
18
  import ViewColumn from 'mdi-material-ui/ViewColumn';
19
+ import UnfoldMore from 'mdi-material-ui/UnfoldMoreHorizontal';
20
+ import UnfoldLess from 'mdi-material-ui/UnfoldLessHorizontal';
19
21
  import { TextField } from '../controls';
20
- export function TableToolbar({ isSearchEnabled, globalFilter, onGlobalFilterChange, isColumnFilterEnabled, columns, width, columnFilterMenuMaxHeight = 400 }) {
22
+ export function TableToolbar({ isSearchEnabled, globalFilter, onGlobalFilterChange, isColumnFilterEnabled, columns, width, columnFilterMenuMaxHeight = 400, isExpandAllEnabled, isAllExpanded, onExpandAllChange }) {
21
23
  const [colMenuAnchor, setColMenuAnchor] = useState(null);
22
24
  const colMenuOpen = Boolean(colMenuAnchor);
23
25
  const [searchResetKey, setSearchResetKey] = useState(0);
@@ -27,7 +29,7 @@ export function TableToolbar({ isSearchEnabled, globalFilter, onGlobalFilterChan
27
29
  }, [
28
30
  onGlobalFilterChange
29
31
  ]);
30
- if (!isSearchEnabled && !isColumnFilterEnabled) {
32
+ if (!isSearchEnabled && !isColumnFilterEnabled && !isExpandAllEnabled) {
31
33
  return null;
32
34
  }
33
35
  return /*#__PURE__*/ _jsxs(Stack, {
@@ -72,6 +74,15 @@ export function TableToolbar({ isSearchEnabled, globalFilter, onGlobalFilterChan
72
74
  flexGrow: 1
73
75
  }
74
76
  }, searchResetKey),
77
+ isExpandAllEnabled && /*#__PURE__*/ _jsx(Tooltip, {
78
+ title: isAllExpanded ? 'Collapse all' : 'Expand all',
79
+ children: /*#__PURE__*/ _jsx(IconButton, {
80
+ onClick: onExpandAllChange,
81
+ color: "info",
82
+ "aria-label": isAllExpanded ? 'collapse all rows' : 'expand all rows',
83
+ children: isAllExpanded ? /*#__PURE__*/ _jsx(UnfoldLess, {}) : /*#__PURE__*/ _jsx(UnfoldMore, {})
84
+ })
85
+ }),
75
86
  isColumnFilterEnabled && /*#__PURE__*/ _jsxs(_Fragment, {
76
87
  children: [
77
88
  /*#__PURE__*/ _jsx(IconButton, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/TableToolbar.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 { Checkbox, IconButton, InputAdornment, ListItemText, Menu, MenuItem, Stack } from '@mui/material';\nimport { Column } from '@tanstack/react-table';\nimport { ReactElement, useCallback, useState } from 'react';\nimport Magnify from 'mdi-material-ui/Magnify';\nimport Close from 'mdi-material-ui/Close';\nimport ViewColumn from 'mdi-material-ui/ViewColumn';\nimport { TextField } from '../controls';\n\nexport interface TableToolbarProps<TableData> {\n /**\n * When `true`, a search input is rendered.\n */\n isSearchEnabled?: boolean;\n\n /**\n * Current value of the global filter / search query.\n */\n globalFilter: string;\n\n /**\n * Callback fired when the search query changes.\n */\n onGlobalFilterChange: (value: string) => void;\n\n /**\n * When `true`, a \"Columns\" button is rendered that opens a column visibility dropdown.\n */\n isColumnFilterEnabled?: boolean;\n\n /**\n * All columns from the table instance, used to build the visibility menu.\n */\n columns: Array<Column<TableData>>;\n /**\n * The width of the toolbar, used to determine when to switch to a more compact layout.\n */\n width: number | string;\n\n /**\n * Max height for the column filter menu.\n */\n columnFilterMenuMaxHeight?: number | string;\n}\n\nexport function TableToolbar<TableData>({\n isSearchEnabled,\n globalFilter,\n onGlobalFilterChange,\n isColumnFilterEnabled,\n columns,\n width,\n columnFilterMenuMaxHeight = 400,\n}: TableToolbarProps<TableData>): ReactElement | null {\n const [colMenuAnchor, setColMenuAnchor] = useState<null | HTMLElement>(null);\n const colMenuOpen = Boolean(colMenuAnchor);\n const [searchResetKey, setSearchResetKey] = useState(0);\n\n const handleSearchClear = useCallback(() => {\n onGlobalFilterChange('');\n setSearchResetKey((prev) => prev + 1);\n }, [onGlobalFilterChange]);\n\n if (!isSearchEnabled && !isColumnFilterEnabled) {\n return null;\n }\n\n return (\n <Stack\n direction=\"row\"\n gap={1}\n alignItems=\"center\"\n justifyContent=\"flex-end\"\n width={width}\n padding=\"0.5rem\"\n sx={{ backgroundColor: (theme) => theme.palette.background.default }}\n >\n {isSearchEnabled && (\n <TextField\n key={searchResetKey}\n placeholder=\"Search...\"\n value={globalFilter}\n onChange={onGlobalFilterChange}\n variant=\"standard\"\n slotProps={{\n htmlInput: { 'aria-label': 'search table' },\n input: {\n startAdornment: (\n <InputAdornment position=\"start\">\n <Magnify fontSize=\"small\" />\n </InputAdornment>\n ),\n endAdornment: globalFilter !== '' && (\n <InputAdornment position=\"end\">\n <IconButton onClick={handleSearchClear}>\n <Close fontSize=\"small\" />\n </IconButton>\n </InputAdornment>\n ),\n },\n }}\n sx={{ flexGrow: 1 }}\n />\n )}\n {isColumnFilterEnabled && (\n <>\n <IconButton\n onClick={(e) => setColMenuAnchor(e.currentTarget)}\n aria-haspopup=\"listbox\"\n aria-expanded={colMenuOpen}\n color=\"info\"\n >\n <ViewColumn />\n </IconButton>\n <Menu\n anchorEl={colMenuAnchor}\n open={colMenuOpen}\n onClose={() => setColMenuAnchor(null)}\n slotProps={{ list: { dense: true } }}\n sx={{ maxHeight: columnFilterMenuMaxHeight }}\n >\n {columns.map((column) => {\n const header = column.columnDef.header;\n const label = typeof header === 'string' ? header : column.id;\n return (\n <MenuItem\n key={column.id}\n disabled={!column.getCanHide()}\n onClick={column.getCanHide() ? column.getToggleVisibilityHandler() : undefined}\n dense\n >\n <Checkbox\n checked={column.getIsVisible()}\n disabled={!column.getCanHide()}\n size=\"small\"\n disableRipple\n sx={{ p: 0, mr: 1 }}\n />\n <ListItemText primary={label} />\n </MenuItem>\n );\n })}\n </Menu>\n </>\n )}\n </Stack>\n );\n}\n"],"names":["Checkbox","IconButton","InputAdornment","ListItemText","Menu","MenuItem","Stack","useCallback","useState","Magnify","Close","ViewColumn","TextField","TableToolbar","isSearchEnabled","globalFilter","onGlobalFilterChange","isColumnFilterEnabled","columns","width","columnFilterMenuMaxHeight","colMenuAnchor","setColMenuAnchor","colMenuOpen","Boolean","searchResetKey","setSearchResetKey","handleSearchClear","prev","direction","gap","alignItems","justifyContent","padding","sx","backgroundColor","theme","palette","background","default","placeholder","value","onChange","variant","slotProps","htmlInput","input","startAdornment","position","fontSize","endAdornment","onClick","flexGrow","e","currentTarget","aria-haspopup","aria-expanded","color","anchorEl","open","onClose","list","dense","maxHeight","map","column","header","columnDef","label","id","disabled","getCanHide","getToggleVisibilityHandler","undefined","checked","get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Ae;oBAC1CC,OAAO;wBACLC,8BACE,KAAC7C;4BAAe8C,UAAS;sCACvB,cAAA,KAACvC;gCAAQwC,UAAS;;;wBAGtBC,cAAcnC,iBAAiB,oBAC7B,KAACb;4BAAe8C,UAAS;sCACvB,cAAA,KAAC/C;gCAAWkD,SAASxB;0CACnB,cAAA,KAACjB;oCAAMuC,UAAS;;;;oBAIxB;gBACF;gBACAf,IAAI;oBAAEkB,UAAU;gBAAE;eAtBb3B;YAyBRR,uCACC;;kCACE,KAAChB;wBACCkD,SAAS,CAACE,IAAM/B,iBAAiB+B,EAAEC,aAAa;wBAChDC,iBAAc;wBACdC,iBAAejC;wBACfkC,OAAM;kCAEN,cAAA,KAAC9C;;kCAEH,KAACP;wBACCsD,UAAUrC;wBACVsC,MAAMpC;wBACNqC,SAAS,IAAMtC,iBAAiB;wBAChCsB,WAAW;4BAAEiB,MAAM;gCAAEC,OAAO;4BAAK;wBAAE;wBACnC5B,IAAI;4BAAE6B,WAAW3C;wBAA0B;kCAE1CF,QAAQ8C,GAAG,CAAC,CAACC;4BACZ,MAAMC,SAASD,OAAOE,SAAS,CAACD,MAAM;4BACtC,MAAME,QAAQ,OAAOF,WAAW,WAAWA,SAASD,OAAOI,EAAE;4BAC7D,qBACE,MAAChE;gCAECiE,UAAU,CAACL,OAAOM,UAAU;gCAC5BpB,SAASc,OAAOM,UAAU,KAAKN,OAAOO,0BAA0B,KAAKC;gCACrEX,KAAK;;kDAEL,KAAC9D;wCACC0E,SAAST,OAAOU,YAAY;wCAC5BL,UAAU,CAACL,OAAOM,UAAU;wCAC5BK,MAAK;wCACLC,aAAa;wCACb3C,IAAI;4CAAE4C,GAAG;4CAAGC,IAAI;wCAAE;;kDAEpB,KAAC5E;wCAAa6E,SAASZ;;;+BAZlBH,OAAOI,EAAE;wBAepB;;;;;;AAMZ"}
1
+ {"version":3,"sources":["../../src/Table/TableToolbar.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 { Checkbox, IconButton, InputAdornment, ListItemText, Menu, MenuItem, Stack, Tooltip } from '@mui/material';\nimport { Column } from '@tanstack/react-table';\nimport { ReactElement, useCallback, useState } from 'react';\nimport Magnify from 'mdi-material-ui/Magnify';\nimport Close from 'mdi-material-ui/Close';\nimport ViewColumn from 'mdi-material-ui/ViewColumn';\nimport UnfoldMore from 'mdi-material-ui/UnfoldMoreHorizontal';\nimport UnfoldLess from 'mdi-material-ui/UnfoldLessHorizontal';\nimport { TextField } from '../controls';\n\nexport interface TableToolbarProps<TableData> {\n /**\n * When `true`, a search input is rendered.\n */\n isSearchEnabled?: boolean;\n\n /**\n * Current value of the global filter / search query.\n */\n globalFilter: string;\n\n /**\n * Callback fired when the search query changes.\n */\n onGlobalFilterChange: (value: string) => void;\n\n /**\n * When `true`, a \"Columns\" button is rendered that opens a column visibility dropdown.\n */\n isColumnFilterEnabled?: boolean;\n\n /**\n * All columns from the table instance, used to build the visibility menu.\n */\n columns: Array<Column<TableData>>;\n /**\n * The width of the toolbar, used to determine when to switch to a more compact layout.\n */\n width: number | string;\n\n /**\n * Max height for the column filter menu.\n */\n columnFilterMenuMaxHeight?: number | string;\n\n /**\n * When `true`, an \"Expand All\" / \"Collapse All\" toggle button is rendered.\n */\n isExpandAllEnabled?: boolean;\n\n /**\n * Whether all rows are currently expanded.\n */\n isAllExpanded?: boolean;\n\n /**\n * Callback to toggle expand/collapse all rows.\n */\n onExpandAllChange?: (event: unknown) => void;\n}\n\nexport function TableToolbar<TableData>({\n isSearchEnabled,\n globalFilter,\n onGlobalFilterChange,\n isColumnFilterEnabled,\n columns,\n width,\n columnFilterMenuMaxHeight = 400,\n isExpandAllEnabled,\n isAllExpanded,\n onExpandAllChange,\n}: TableToolbarProps<TableData>): ReactElement | null {\n const [colMenuAnchor, setColMenuAnchor] = useState<null | HTMLElement>(null);\n const colMenuOpen = Boolean(colMenuAnchor);\n const [searchResetKey, setSearchResetKey] = useState(0);\n\n const handleSearchClear = useCallback(() => {\n onGlobalFilterChange('');\n setSearchResetKey((prev) => prev + 1);\n }, [onGlobalFilterChange]);\n\n if (!isSearchEnabled && !isColumnFilterEnabled && !isExpandAllEnabled) {\n return null;\n }\n\n return (\n <Stack\n direction=\"row\"\n gap={1}\n alignItems=\"center\"\n justifyContent=\"flex-end\"\n width={width}\n padding=\"0.5rem\"\n sx={{ backgroundColor: (theme) => theme.palette.background.default }}\n >\n {isSearchEnabled && (\n <TextField\n key={searchResetKey}\n placeholder=\"Search...\"\n value={globalFilter}\n onChange={onGlobalFilterChange}\n variant=\"standard\"\n slotProps={{\n htmlInput: { 'aria-label': 'search table' },\n input: {\n startAdornment: (\n <InputAdornment position=\"start\">\n <Magnify fontSize=\"small\" />\n </InputAdornment>\n ),\n endAdornment: globalFilter !== '' && (\n <InputAdornment position=\"end\">\n <IconButton onClick={handleSearchClear}>\n <Close fontSize=\"small\" />\n </IconButton>\n </InputAdornment>\n ),\n },\n }}\n sx={{ flexGrow: 1 }}\n />\n )}\n {isExpandAllEnabled && (\n <Tooltip title={isAllExpanded ? 'Collapse all' : 'Expand all'}>\n <IconButton\n onClick={onExpandAllChange}\n color=\"info\"\n aria-label={isAllExpanded ? 'collapse all rows' : 'expand all rows'}\n >\n {isAllExpanded ? <UnfoldLess /> : <UnfoldMore />}\n </IconButton>\n </Tooltip>\n )}\n {isColumnFilterEnabled && (\n <>\n <IconButton\n onClick={(e) => setColMenuAnchor(e.currentTarget)}\n aria-haspopup=\"listbox\"\n aria-expanded={colMenuOpen}\n color=\"info\"\n >\n <ViewColumn />\n </IconButton>\n <Menu\n anchorEl={colMenuAnchor}\n open={colMenuOpen}\n onClose={() => setColMenuAnchor(null)}\n slotProps={{ list: { dense: true } }}\n sx={{ maxHeight: columnFilterMenuMaxHeight }}\n >\n {columns.map((column) => {\n const header = column.columnDef.header;\n const label = typeof header === 'string' ? header : column.id;\n return (\n <MenuItem\n key={column.id}\n disabled={!column.getCanHide()}\n onClick={column.getCanHide() ? column.getToggleVisibilityHandler() : undefined}\n dense\n >\n <Checkbox\n checked={column.getIsVisible()}\n disabled={!column.getCanHide()}\n size=\"small\"\n disableRipple\n sx={{ p: 0, mr: 1 }}\n />\n <ListItemText primary={label} />\n </MenuItem>\n );\n })}\n </Menu>\n </>\n )}\n </Stack>\n );\n}\n"],"names":["Checkbox","IconButton","InputAdornment","ListItemText","Menu","MenuItem","Stack","Tooltip","useCallback","useState","Magnify","Close","ViewColumn","UnfoldMore","UnfoldLess","TextField","TableToolbar","isSearchEnabled","globalFilter","onGlobalFilterChange","isColumnFilterEnabled","columns","width","columnFilterMenuMaxHeight","isExpandAllEnabled","isAllExpanded","onExpandAllChange","colMenuAnchor","setColMenuAnchor","colMenuOpen","Boolean","searchResetKey","setSearchResetKey","handleSearchClear","prev","direction","gap","alignItems","justifyContent","padding","sx","backgroundColor","theme","palette","background","default","placeholder","value","onChange","variant","slotProps","htmlInput","input","startAdornment","position","fontSize","endAdornment","onClick","flexGrow","title","color","aria-label","e","currentTarget","aria-haspopup","aria-expanded","anchorEl","open","onClose","list","dense","maxHeight","map","column","header","columnDef","label","id","disabled","getCanHide","getToggleVisibilityHandler","undefined","checked","getIsVisible","size","disableRipple","p","mr","primary"],"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,QAAQ,EAAEC,UAAU,EAAEC,cAAc,EAAEC,YAAY,EAAEC,IAAI,EAAEC,QAA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ColumnSizingInfoState, ColumnSizingState, HeaderGroup, Row } from '@tanstack/react-table';
2
2
  import { ReactElement } from 'react';
3
3
  import { TableToolbarProps } from './TableToolbar';
4
4
  import { TableCellConfigs, TableProps } from './model/table-model';
5
- export type VirtualizedTableProps<TableData> = Required<Pick<TableProps<TableData>, 'height' | 'width' | 'density' | 'defaultColumnWidth' | 'defaultColumnHeight'>> & Pick<TableProps<TableData>, 'onRowMouseOver' | 'onRowMouseOut' | 'pagination' | 'onPaginationChange'> & {
5
+ export type VirtualizedTableProps<TableData> = Required<Pick<TableProps<TableData>, 'height' | 'width' | 'density' | 'defaultColumnHeight' | 'defaultColumnWidth'>> & Pick<TableProps<TableData>, 'onRowMouseOver' | 'onRowMouseOut' | 'pagination' | 'onPaginationChange'> & {
6
6
  onRowClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, id: string) => void;
7
7
  rows: Array<Row<TableData>>;
8
8
  columns: Array<Column<TableData, unknown>>;
9
9
  headers: Array<HeaderGroup<TableData>>;
10
+ columnSizing: ColumnSizingState;
11
+ columnSizingInfo: ColumnSizingInfoState;
10
12
  cellConfigs?: TableCellConfigs;
11
13
  rowCount: number;
12
- toolbarConfig: Pick<TableToolbarProps<TableData>, 'isSearchEnabled' | 'globalFilter' | 'onGlobalFilterChange' | 'isColumnFilterEnabled' | 'columns' | 'columnFilterMenuMaxHeight'>;
14
+ toolbarConfig: Pick<TableToolbarProps<TableData>, 'isSearchEnabled' | 'globalFilter' | 'onGlobalFilterChange' | 'isColumnFilterEnabled' | 'columns' | 'columnFilterMenuMaxHeight' | 'isExpandAllEnabled' | 'isAllExpanded' | 'onExpandAllChange'>;
13
15
  };
14
- export declare function VirtualizedTable<TableData>({ width, height, density, defaultColumnWidth, defaultColumnHeight, onRowClick, onRowMouseOver, onRowMouseOut, rows, columns, headers, cellConfigs, pagination, onPaginationChange, rowCount, toolbarConfig, }: VirtualizedTableProps<TableData>): ReactElement;
16
+ export declare function VirtualizedTable<TableData>({ width, height, density, defaultColumnWidth, defaultColumnHeight, onRowClick, onRowMouseOver, onRowMouseOut, rows, columns, headers, columnSizing, columnSizingInfo, cellConfigs, pagination, onPaginationChange, rowCount, toolbarConfig, }: VirtualizedTableProps<TableData>): ReactElement;
15
17
  //# sourceMappingURL=VirtualizedTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedTable.d.ts","sourceRoot":"","sources":["../../src/Table/VirtualizedTable.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAc,WAAW,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAmB,MAAM,OAAO,CAAC;AACtD,OAAO,EAAgB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAQjE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAqB,MAAM,qBAAqB,CAAC;AAStF,MAAM,MAAM,qBAAqB,CAAC,SAAS,IAAI,QAAQ,CACrD,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,oBAAoB,GAAG,qBAAqB,CAAC,CAC3G,GACC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,gBAAgB,GAAG,eAAe,GAAG,YAAY,GAAG,oBAAoB,CAAC,GAAG;IACtG,UAAU,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClF,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5B,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3C,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,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