@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.
- package/dist/AlignSelector/AlignSelector.js +115 -25
- package/dist/AlignSelector/AlignSelector.js.map +1 -1
- package/dist/CodeEditor/CodeEditor.d.ts +19 -0
- package/dist/CodeEditor/CodeEditor.d.ts.map +1 -0
- package/dist/CodeEditor/CodeEditor.js +122 -0
- package/dist/CodeEditor/CodeEditor.js.map +1 -0
- package/dist/ColorPicker/ColorPicker.js +153 -61
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/OptionsColorPicker.js +147 -52
- package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js +144 -41
- package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
- package/dist/DensitySelector/DensitySelector.js +53 -20
- package/dist/DensitySelector/DensitySelector.js.map +1 -1
- package/dist/Dialog/Dialog.d.ts +3 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +202 -49
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Dialog/DiscardChangesConfirmationDialog.js +79 -27
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/DragAndDrop/DragAndDropList.js +184 -113
- package/dist/DragAndDrop/DragAndDropList.js.map +1 -1
- package/dist/DragAndDrop/DragButton.js +131 -52
- package/dist/DragAndDrop/DragButton.js.map +1 -1
- package/dist/DragAndDrop/DropIndicator.js +51 -26
- package/dist/DragAndDrop/DropIndicator.js.map +1 -1
- package/dist/Drawer/Drawer.js +75 -15
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/EChart/EChart.js +179 -90
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/ErrorAlert.js +14 -4
- package/dist/ErrorAlert.js.map +1 -1
- package/dist/ExemplarMetadata/ExemplarMetadataTooltip.js +463 -190
- package/dist/ExemplarMetadata/ExemplarMetadataTooltip.js.map +1 -1
- package/dist/FontSizeSelector/FontSizeSelector.js +82 -50
- package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
- package/dist/FormEditor/FormActions.js +88 -14
- package/dist/FormEditor/FormActions.js.map +1 -1
- package/dist/FormatControls/FormatControls.js +246 -99
- package/dist/FormatControls/FormatControls.js.map +1 -1
- package/dist/FormatControls/UnitSelector.js +90 -25
- package/dist/FormatControls/UnitSelector.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js +105 -42
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/JSONEditor.d.ts +2 -6
- package/dist/JSONEditor.d.ts.map +1 -1
- package/dist/JSONEditor.js +24 -37
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/CompactLegend.js +77 -27
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.js +184 -82
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/LegendColorBadge.js +54 -9
- package/dist/Legend/LegendColorBadge.js.map +1 -1
- package/dist/Legend/ListLegend.js +46 -16
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.js +184 -48
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/Legend/TableLegend.d.ts.map +1 -1
- package/dist/Legend/TableLegend.js +90 -48
- package/dist/Legend/TableLegend.js.map +1 -1
- package/dist/Legend/legend-model.d.ts +2 -2
- package/dist/Legend/legend-model.d.ts.map +1 -1
- package/dist/Legend/legend-model.js.map +1 -1
- package/dist/LinksEditor/LinkEditorForm.js +148 -67
- package/dist/LinksEditor/LinkEditorForm.js.map +1 -1
- package/dist/ModeSelector/ModeSelector.js +61 -19
- package/dist/ModeSelector/ModeSelector.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js +20 -9
- package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js +130 -54
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js +17 -6
- package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js +76 -28
- package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
- package/dist/Overlay/Overlay.js +71 -27
- package/dist/Overlay/Overlay.js.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +96 -38
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
- package/dist/RepeatGrid/RepeatGrid.js +117 -45
- package/dist/RepeatGrid/RepeatGrid.js.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js +99 -38
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
- package/dist/SortSelector/SortSelector.js +51 -18
- package/dist/SortSelector/SortSelector.js.map +1 -1
- package/dist/SortSelector/SortSelectorButtons.js +109 -25
- package/dist/SortSelector/SortSelectorButtons.js.map +1 -1
- package/dist/Table/InnerTable.js +46 -15
- package/dist/Table/InnerTable.js.map +1 -1
- package/dist/Table/Table.d.ts +3 -1
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +410 -158
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableBody.js +15 -4
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableCell.js +284 -107
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableCheckbox.js +101 -32
- package/dist/Table/TableCheckbox.js.map +1 -1
- package/dist/Table/TableFoot.js +15 -4
- package/dist/Table/TableFoot.js.map +1 -1
- package/dist/Table/TableHead.js +15 -4
- package/dist/Table/TableHead.js.map +1 -1
- package/dist/Table/TableHeaderCell.js +119 -62
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/TableRow.js +33 -9
- package/dist/Table/TableRow.js.map +1 -1
- package/dist/Table/TableToolbar.d.ts +5 -4
- package/dist/Table/TableToolbar.d.ts.map +1 -1
- package/dist/Table/TableToolbar.js +172 -100
- package/dist/Table/TableToolbar.js.map +1 -1
- package/dist/Table/VirtualizedTable.d.ts +11 -11
- package/dist/Table/VirtualizedTable.d.ts.map +1 -1
- package/dist/Table/VirtualizedTable.js +387 -219
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/VirtualizedTableContainer.js +27 -7
- package/dist/Table/VirtualizedTableContainer.js.map +1 -1
- package/dist/Table/hooks/useFuzzySearch.d.ts +6 -5
- package/dist/Table/hooks/useFuzzySearch.d.ts.map +1 -1
- package/dist/Table/hooks/useFuzzySearch.js +57 -32
- package/dist/Table/hooks/useFuzzySearch.js.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js +115 -74
- package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +74 -53
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
- package/dist/Table/model/table-model.d.ts +44 -15
- package/dist/Table/model/table-model.d.ts.map +1 -1
- package/dist/Table/model/table-model.js +33 -1
- package/dist/Table/model/table-model.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js +137 -47
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +341 -174
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.js +368 -162
- package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
- package/dist/TimeRangeSelector/TimeRangeSelector.js +580 -209
- package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +189 -65
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +168 -78
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesMarker.js +38 -11
- package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +229 -72
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js +73 -27
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +221 -121
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +44 -38
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeZoneSelector.js +131 -36
- package/dist/TimeZoneSelector.js.map +1 -1
- package/dist/ToolbarIconButton/ToolbarIconButton.js +18 -7
- package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
- package/dist/TransformsEditor/TransformEditor.js +830 -334
- package/dist/TransformsEditor/TransformEditor.js.map +1 -1
- package/dist/TransformsEditor/TransformEditorContainer.js +252 -90
- package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
- package/dist/TransformsEditor/TransformsEditor.js +170 -59
- package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
- package/dist/ValueMappingEditor/ValueMappingEditor.js +800 -322
- package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -1
- package/dist/ValueMappingEditor/ValueMappingsEditor.js +218 -91
- package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -1
- package/dist/YAMLEditor/YAMLEditor.d.ts +12 -0
- package/dist/YAMLEditor/YAMLEditor.d.ts.map +1 -0
- package/dist/YAMLEditor/YAMLEditor.js +41 -0
- package/dist/YAMLEditor/YAMLEditor.js.map +1 -0
- package/dist/YAMLEditor/index.d.ts +2 -0
- package/dist/YAMLEditor/index.d.ts.map +1 -0
- package/dist/YAMLEditor/index.js +15 -0
- package/dist/YAMLEditor/index.js.map +1 -0
- package/dist/YAMLEditor/yaml-utils.d.ts +11 -0
- package/dist/YAMLEditor/yaml-utils.d.ts.map +1 -0
- package/dist/YAMLEditor/yaml-utils.js +52 -0
- package/dist/YAMLEditor/yaml-utils.js.map +1 -0
- package/dist/YAxisLabel.js +64 -20
- package/dist/YAxisLabel.js.map +1 -1
- package/dist/context/ChartsProvider.js +32 -16
- package/dist/context/ChartsProvider.js.map +1 -1
- package/dist/context/ItemActionsProvider.js +110 -61
- package/dist/context/ItemActionsProvider.js.map +1 -1
- package/dist/context/SelectionProvider.js +170 -66
- package/dist/context/SelectionProvider.js.map +1 -1
- package/dist/context/SnackbarProvider.js +101 -44
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.js +35 -14
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/controls/TextField.js +86 -25
- package/dist/controls/TextField.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/browser-storage.js +64 -34
- package/dist/utils/browser-storage.js.map +1 -1
- package/package.json +12 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } 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.
|
|
@@ -15,12 +16,22 @@ import { Grid } from "@mui/material";
|
|
|
15
16
|
/**
|
|
16
17
|
* Top level grid container used to lay out content for editing in panel
|
|
17
18
|
* options.
|
|
18
|
-
*/ export const OptionsEditorGrid = (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
*/ export const OptionsEditorGrid = (t0)=>{
|
|
20
|
+
const $ = _c(2);
|
|
21
|
+
const { children } = t0;
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[0] !== children) {
|
|
24
|
+
t1 = /*#__PURE__*/ _jsx(Grid, {
|
|
25
|
+
container: true,
|
|
26
|
+
spacing: 8,
|
|
27
|
+
children: children
|
|
28
|
+
});
|
|
29
|
+
$[0] = children;
|
|
30
|
+
$[1] = t1;
|
|
31
|
+
} else {
|
|
32
|
+
t1 = $[1];
|
|
33
|
+
}
|
|
34
|
+
return t1;
|
|
24
35
|
};
|
|
25
36
|
|
|
26
37
|
//# sourceMappingURL=OptionsEditorGrid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorGrid.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 { Grid } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nexport type OptionsEditorGridProps = {\n /**\n * 1-3 `OptionsEditorColumn` components to render content in columns.\n */\n children: React.ReactNode;\n};\n\n/**\n * Top level grid container used to lay out content for editing in panel\n * options.\n */\nexport const OptionsEditorGrid = ({ children }: OptionsEditorGridProps): ReactElement => {\n return (\n <Grid container spacing={8}>\n {children}\n </Grid>\n );\n};\n"],"names":["Grid","OptionsEditorGrid"
|
|
1
|
+
{"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorGrid.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 { Grid } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nexport type OptionsEditorGridProps = {\n /**\n * 1-3 `OptionsEditorColumn` components to render content in columns.\n */\n children: React.ReactNode;\n};\n\n/**\n * Top level grid container used to lay out content for editing in panel\n * options.\n */\nexport const OptionsEditorGrid = ({ children }: OptionsEditorGridProps): ReactElement => {\n return (\n <Grid container spacing={8}>\n {children}\n </Grid>\n );\n};\n"],"names":["Grid","OptionsEditorGrid"],"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,IAAI,QAAQ,gBAAgB;AAUrC;;;CAGC,GACD,OAAO,MAAMC,oBAAoB;;;;;;;;;;;;;;;;EAM/B"}
|
|
@@ -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.
|
|
@@ -15,34 +16,81 @@ import { Box, Typography, Stack } from "@mui/material";
|
|
|
15
16
|
import React from "react";
|
|
16
17
|
/**
|
|
17
18
|
* Group similar content within panel options.
|
|
18
|
-
*/ export const OptionsEditorGroup = (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
]
|
|
45
|
-
}
|
|
19
|
+
*/ export const OptionsEditorGroup = (t0)=>{
|
|
20
|
+
const $ = _c(12);
|
|
21
|
+
const { title, children, icon } = t0;
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[0] !== title) {
|
|
24
|
+
t1 = /*#__PURE__*/ _jsx(Typography, {
|
|
25
|
+
variant: "overline",
|
|
26
|
+
component: "h4",
|
|
27
|
+
children: title
|
|
28
|
+
});
|
|
29
|
+
$[0] = title;
|
|
30
|
+
$[1] = t1;
|
|
31
|
+
} else {
|
|
32
|
+
t1 = $[1];
|
|
33
|
+
}
|
|
34
|
+
let t2;
|
|
35
|
+
if ($[2] !== icon) {
|
|
36
|
+
t2 = icon && /*#__PURE__*/ _jsx(Box, {
|
|
37
|
+
sx: {
|
|
38
|
+
marginLeft: "auto"
|
|
39
|
+
},
|
|
40
|
+
children: icon
|
|
41
|
+
});
|
|
42
|
+
$[2] = icon;
|
|
43
|
+
$[3] = t2;
|
|
44
|
+
} else {
|
|
45
|
+
t2 = $[3];
|
|
46
|
+
}
|
|
47
|
+
let t3;
|
|
48
|
+
if ($[4] !== t1 || $[5] !== t2) {
|
|
49
|
+
t3 = /*#__PURE__*/ _jsxs(Box, {
|
|
50
|
+
display: "flex",
|
|
51
|
+
borderBottom: 1,
|
|
52
|
+
borderColor: "grey.300",
|
|
53
|
+
marginBottom: _temp,
|
|
54
|
+
children: [
|
|
55
|
+
t1,
|
|
56
|
+
t2
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
$[4] = t1;
|
|
60
|
+
$[5] = t2;
|
|
61
|
+
$[6] = t3;
|
|
62
|
+
} else {
|
|
63
|
+
t3 = $[6];
|
|
64
|
+
}
|
|
65
|
+
let t4;
|
|
66
|
+
if ($[7] !== children) {
|
|
67
|
+
t4 = /*#__PURE__*/ _jsx(Stack, {
|
|
68
|
+
spacing: 1,
|
|
69
|
+
children: children
|
|
70
|
+
});
|
|
71
|
+
$[7] = children;
|
|
72
|
+
$[8] = t4;
|
|
73
|
+
} else {
|
|
74
|
+
t4 = $[8];
|
|
75
|
+
}
|
|
76
|
+
let t5;
|
|
77
|
+
if ($[9] !== t3 || $[10] !== t4) {
|
|
78
|
+
t5 = /*#__PURE__*/ _jsxs(Box, {
|
|
79
|
+
children: [
|
|
80
|
+
t3,
|
|
81
|
+
t4
|
|
82
|
+
]
|
|
83
|
+
});
|
|
84
|
+
$[9] = t3;
|
|
85
|
+
$[10] = t4;
|
|
86
|
+
$[11] = t5;
|
|
87
|
+
} else {
|
|
88
|
+
t5 = $[11];
|
|
89
|
+
}
|
|
90
|
+
return t5;
|
|
46
91
|
};
|
|
92
|
+
function _temp(theme) {
|
|
93
|
+
return theme.spacing(1);
|
|
94
|
+
}
|
|
47
95
|
|
|
48
96
|
//# sourceMappingURL=OptionsEditorGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorGroup.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 { Box, Typography, Stack } from '@mui/material';\nimport type { ReactElement } from 'react';\nimport React from 'react';\n\nexport type OptionsEditorGroupProps = {\n /**\n * Text that communicates the purpose of the grouping.\n */\n title: string;\n children: React.ReactNode;\n icon?: React.ReactNode;\n};\n\n/**\n * Group similar content within panel options.\n */\nexport const OptionsEditorGroup = ({ title, children, icon }: OptionsEditorGroupProps): ReactElement => {\n return (\n <Box>\n <Box display=\"flex\" borderBottom={1} borderColor=\"grey.300\" marginBottom={(theme) => theme.spacing(1)}>\n <Typography variant=\"overline\" component=\"h4\">\n {title}\n </Typography>\n {icon && <Box sx={{ marginLeft: 'auto' }}>{icon}</Box>}\n </Box>\n <Stack spacing={1}>{children}</Stack>\n </Box>\n );\n};\n"],"names":["Box","Typography","Stack","React","OptionsEditorGroup"
|
|
1
|
+
{"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorGroup.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 { Box, Typography, Stack } from '@mui/material';\nimport type { ReactElement } from 'react';\nimport React from 'react';\n\nexport type OptionsEditorGroupProps = {\n /**\n * Text that communicates the purpose of the grouping.\n */\n title: string;\n children: React.ReactNode;\n icon?: React.ReactNode;\n};\n\n/**\n * Group similar content within panel options.\n */\nexport const OptionsEditorGroup = ({ title, children, icon }: OptionsEditorGroupProps): ReactElement => {\n return (\n <Box>\n <Box display=\"flex\" borderBottom={1} borderColor=\"grey.300\" marginBottom={(theme) => theme.spacing(1)}>\n <Typography variant=\"overline\" component=\"h4\">\n {title}\n </Typography>\n {icon && <Box sx={{ marginLeft: 'auto' }}>{icon}</Box>}\n </Box>\n <Stack spacing={1}>{children}</Stack>\n </Box>\n );\n};\n"],"names":["Box","Typography","Stack","React","OptionsEditorGroup"],"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,GAAG,EAAEC,UAAU,EAAEC,KAAK,QAAQ,gBAAgB;AAEvD,OAAOC,WAAW,QAAQ;AAW1B;;CAEC,GACD,OAAO,MAAMC,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYhC"}
|
package/dist/Overlay/Overlay.js
CHANGED
|
@@ -11,42 +11,86 @@
|
|
|
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 { Skeleton, Stack, Typography } from "@mui/material";
|
|
15
16
|
export function TextOverlay(props) {
|
|
17
|
+
const $ = _c(3);
|
|
16
18
|
const { message } = props;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
let t0;
|
|
20
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
21
|
+
t0 = {
|
|
22
|
+
height: "100%",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
justifyContent: "center"
|
|
25
|
+
};
|
|
26
|
+
$[0] = t0;
|
|
27
|
+
} else {
|
|
28
|
+
t0 = $[0];
|
|
29
|
+
}
|
|
30
|
+
let t1;
|
|
31
|
+
if ($[1] !== message) {
|
|
32
|
+
t1 = /*#__PURE__*/ _jsx(Stack, {
|
|
33
|
+
sx: t0,
|
|
34
|
+
children: /*#__PURE__*/ _jsx(Typography, {
|
|
35
|
+
children: message
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
$[1] = message;
|
|
39
|
+
$[2] = t1;
|
|
40
|
+
} else {
|
|
41
|
+
t1 = $[2];
|
|
42
|
+
}
|
|
43
|
+
return t1;
|
|
27
44
|
}
|
|
28
45
|
export function NoDataOverlay(props) {
|
|
46
|
+
const $ = _c(2);
|
|
29
47
|
const { resource } = props;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
48
|
+
const t0 = `No ${resource}`;
|
|
49
|
+
let t1;
|
|
50
|
+
if ($[0] !== t0) {
|
|
51
|
+
t1 = /*#__PURE__*/ _jsx(TextOverlay, {
|
|
52
|
+
message: t0
|
|
53
|
+
});
|
|
54
|
+
$[0] = t0;
|
|
55
|
+
$[1] = t1;
|
|
56
|
+
} else {
|
|
57
|
+
t1 = $[1];
|
|
58
|
+
}
|
|
59
|
+
return t1;
|
|
33
60
|
}
|
|
34
61
|
export function LoadingOverlay(props) {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
62
|
+
const $ = _c(3);
|
|
63
|
+
const { variant: t0 } = props;
|
|
64
|
+
const variant = t0 === undefined ? "rounded" : t0;
|
|
65
|
+
let t1;
|
|
66
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
67
|
+
t1 = {
|
|
68
|
+
height: "100%",
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
justifyContent: "center",
|
|
41
71
|
px: 1
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
72
|
+
};
|
|
73
|
+
$[0] = t1;
|
|
74
|
+
} else {
|
|
75
|
+
t1 = $[0];
|
|
76
|
+
}
|
|
77
|
+
let t2;
|
|
78
|
+
if ($[1] !== variant) {
|
|
79
|
+
t2 = /*#__PURE__*/ _jsx(Stack, {
|
|
80
|
+
sx: t1,
|
|
81
|
+
children: /*#__PURE__*/ _jsx(Skeleton, {
|
|
82
|
+
variant: variant,
|
|
83
|
+
width: "100%",
|
|
84
|
+
height: "30%",
|
|
85
|
+
"aria-label": "Loading..."
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
$[1] = variant;
|
|
89
|
+
$[2] = t2;
|
|
90
|
+
} else {
|
|
91
|
+
t2 = $[2];
|
|
92
|
+
}
|
|
93
|
+
return t2;
|
|
50
94
|
}
|
|
51
95
|
|
|
52
96
|
//# sourceMappingURL=Overlay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Overlay/Overlay.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 { SkeletonOwnProps } from '@mui/material';\nimport { Skeleton, Stack, Typography } from '@mui/material';\nimport type { ReactElement } from 'react';\n\ninterface TextOverlayProps {\n message: string;\n}\n\nexport function TextOverlay(props: TextOverlayProps): ReactElement {\n const { message } = props;\n\n return (\n <Stack sx={{ height: '100%', alignItems: 'center', justifyContent: 'center' }}>\n <Typography>{message}</Typography>\n </Stack>\n );\n}\n\ninterface NoDataOverlayProps {\n resource: string;\n}\n\nexport function NoDataOverlay(props: NoDataOverlayProps): ReactElement {\n const { resource } = props;\n\n return <TextOverlay message={`No ${resource}`} />;\n}\n\ninterface LoadingOverlayProps {\n variant?: SkeletonOwnProps['variant'];\n}\n\nexport function LoadingOverlay(props: LoadingOverlayProps): ReactElement {\n const { variant = 'rounded' } = props;\n\n return (\n <Stack sx={{ height: '100%', alignItems: 'center', justifyContent: 'center', px: 1 }}>\n <Skeleton variant={variant} width=\"100%\" height=\"30%\" aria-label=\"Loading...\" />\n </Stack>\n );\n}\n"],"names":["Skeleton","Stack","Typography"
|
|
1
|
+
{"version":3,"sources":["../../src/Overlay/Overlay.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 { SkeletonOwnProps } from '@mui/material';\nimport { Skeleton, Stack, Typography } from '@mui/material';\nimport type { ReactElement } from 'react';\n\ninterface TextOverlayProps {\n message: string;\n}\n\nexport function TextOverlay(props: TextOverlayProps): ReactElement {\n const { message } = props;\n\n return (\n <Stack sx={{ height: '100%', alignItems: 'center', justifyContent: 'center' }}>\n <Typography>{message}</Typography>\n </Stack>\n );\n}\n\ninterface NoDataOverlayProps {\n resource: string;\n}\n\nexport function NoDataOverlay(props: NoDataOverlayProps): ReactElement {\n const { resource } = props;\n\n return <TextOverlay message={`No ${resource}`} />;\n}\n\ninterface LoadingOverlayProps {\n variant?: SkeletonOwnProps['variant'];\n}\n\nexport function LoadingOverlay(props: LoadingOverlayProps): ReactElement {\n const { variant = 'rounded' } = props;\n\n return (\n <Stack sx={{ height: '100%', alignItems: 'center', justifyContent: 'center', px: 1 }}>\n <Skeleton variant={variant} width=\"100%\" height=\"30%\" aria-label=\"Loading...\" />\n </Stack>\n );\n}\n"],"names":["Skeleton","Stack","Typography"],"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,EAAEC,UAAU,QAAQ,gBAAgB;AAO5D,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcP,OAAO;;;;;;;;;;;;;;;;AAUP,OAAO"}
|
|
@@ -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.
|
|
@@ -12,49 +13,106 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
13
|
// See the License for the specific language governing permissions and
|
|
13
14
|
// limitations under the License.
|
|
14
15
|
import { Box, FormControl, MenuItem, Select } from "@mui/material";
|
|
15
|
-
import { useMemo } from "react";
|
|
16
16
|
export function RefreshIntervalPicker(props) {
|
|
17
|
+
const $ = _c(17);
|
|
17
18
|
const { value, onChange, timeOptions, height } = props;
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
let t0;
|
|
20
|
+
bb0: {
|
|
20
21
|
if (value && !timeOptions.some((option)=>option.value.pastDuration === value)) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[0] !== value) {
|
|
24
|
+
t1 = /*#__PURE__*/ _jsx(MenuItem, {
|
|
25
|
+
value: value,
|
|
26
|
+
children: value
|
|
27
|
+
});
|
|
28
|
+
$[0] = value;
|
|
29
|
+
$[1] = t1;
|
|
30
|
+
} else {
|
|
31
|
+
t1 = $[1];
|
|
32
|
+
}
|
|
33
|
+
t0 = t1;
|
|
34
|
+
break bb0;
|
|
25
35
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
t0 = undefined;
|
|
37
|
+
}
|
|
38
|
+
const customInterval = t0;
|
|
39
|
+
let t1;
|
|
40
|
+
if ($[2] !== onChange) {
|
|
41
|
+
t1 = (event)=>{
|
|
42
|
+
const duration = event.target.value;
|
|
43
|
+
onChange(duration);
|
|
44
|
+
};
|
|
45
|
+
$[2] = onChange;
|
|
46
|
+
$[3] = t1;
|
|
47
|
+
} else {
|
|
48
|
+
t1 = $[3];
|
|
49
|
+
}
|
|
50
|
+
const t2 = `Select refresh interval. Currently set to ${value}`;
|
|
51
|
+
let t3;
|
|
52
|
+
if ($[4] !== t2) {
|
|
53
|
+
t3 = {
|
|
54
|
+
"aria-label": t2
|
|
55
|
+
};
|
|
56
|
+
$[4] = t2;
|
|
57
|
+
$[5] = t3;
|
|
58
|
+
} else {
|
|
59
|
+
t3 = $[5];
|
|
60
|
+
}
|
|
61
|
+
let t4;
|
|
62
|
+
if ($[6] !== height) {
|
|
63
|
+
t4 = {
|
|
64
|
+
".MuiSelect-select": height ? {
|
|
65
|
+
lineHeight: height,
|
|
66
|
+
paddingY: 0
|
|
67
|
+
} : {}
|
|
68
|
+
};
|
|
69
|
+
$[6] = height;
|
|
70
|
+
$[7] = t4;
|
|
71
|
+
} else {
|
|
72
|
+
t4 = $[7];
|
|
73
|
+
}
|
|
74
|
+
let t5;
|
|
75
|
+
if ($[8] !== timeOptions) {
|
|
76
|
+
t5 = timeOptions.map(_temp);
|
|
77
|
+
$[8] = timeOptions;
|
|
78
|
+
$[9] = t5;
|
|
79
|
+
} else {
|
|
80
|
+
t5 = $[9];
|
|
81
|
+
}
|
|
82
|
+
let t6;
|
|
83
|
+
if ($[10] !== customInterval || $[11] !== t1 || $[12] !== t3 || $[13] !== t4 || $[14] !== t5 || $[15] !== value) {
|
|
84
|
+
t6 = /*#__PURE__*/ _jsx(FormControl, {
|
|
85
|
+
children: /*#__PURE__*/ _jsx(Box, {
|
|
86
|
+
children: /*#__PURE__*/ _jsxs(Select, {
|
|
87
|
+
id: "refreshInterval",
|
|
88
|
+
value: value,
|
|
89
|
+
onChange: t1,
|
|
90
|
+
inputProps: t3,
|
|
91
|
+
sx: t4,
|
|
92
|
+
children: [
|
|
93
|
+
t5,
|
|
94
|
+
customInterval
|
|
95
|
+
]
|
|
96
|
+
})
|
|
55
97
|
})
|
|
56
|
-
})
|
|
57
|
-
|
|
98
|
+
});
|
|
99
|
+
$[10] = customInterval;
|
|
100
|
+
$[11] = t1;
|
|
101
|
+
$[12] = t3;
|
|
102
|
+
$[13] = t4;
|
|
103
|
+
$[14] = t5;
|
|
104
|
+
$[15] = value;
|
|
105
|
+
$[16] = t6;
|
|
106
|
+
} else {
|
|
107
|
+
t6 = $[16];
|
|
108
|
+
}
|
|
109
|
+
return t6;
|
|
110
|
+
}
|
|
111
|
+
function _temp(item, idx) {
|
|
112
|
+
return /*#__PURE__*/ _jsx(MenuItem, {
|
|
113
|
+
value: item.value.pastDuration,
|
|
114
|
+
children: item.display
|
|
115
|
+
}, idx);
|
|
58
116
|
}
|
|
59
117
|
|
|
60
118
|
//# sourceMappingURL=RefreshIntervalPicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/RefreshIntervalPicker/RefreshIntervalPicker.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 { Box, FormControl, MenuItem, Select } from '@mui/material';\nimport type { DurationString } from '@perses-dev/spec';\nimport type { ReactElement } from 'react';\nimport { useMemo } from 'react';\n\nimport type { TimeOption } from '../model';\n\ninterface RefreshIntervalPickerProps {\n timeOptions: TimeOption[];\n value?: DurationString;\n onChange: (value: DurationString) => void;\n height?: string;\n}\n\nexport function RefreshIntervalPicker(props: RefreshIntervalPickerProps): ReactElement {\n const { value, onChange, timeOptions, height } = props;\n\n // If the dashboard refresh interval is not provided in timeOptions, it will create a specific option for the select\n const customInterval = useMemo(() => {\n if (value && !timeOptions.some((option) => option.value.pastDuration === value)) {\n return <MenuItem value={value}>{value}</MenuItem>;\n }\n }, [timeOptions, value]);\n\n return (\n <FormControl>\n <Box>\n <Select\n id=\"refreshInterval\"\n value={value}\n onChange={(event) => {\n const duration = event.target.value as DurationString;\n onChange(duration);\n }}\n inputProps={{\n 'aria-label': `Select refresh interval. Currently set to ${value}`,\n }}\n sx={{\n '.MuiSelect-select': height ? { lineHeight: height, paddingY: 0 } : {},\n }}\n >\n {timeOptions.map((item, idx) => (\n <MenuItem key={idx} value={item.value.pastDuration}>\n {item.display}\n </MenuItem>\n ))}\n {customInterval}\n </Select>\n </Box>\n </FormControl>\n );\n}\n"],"names":["Box","FormControl","MenuItem","Select"
|
|
1
|
+
{"version":3,"sources":["../../src/RefreshIntervalPicker/RefreshIntervalPicker.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 { Box, FormControl, MenuItem, Select } from '@mui/material';\nimport type { DurationString } from '@perses-dev/spec';\nimport type { ReactElement } from 'react';\nimport { useMemo } from 'react';\n\nimport type { TimeOption } from '../model';\n\ninterface RefreshIntervalPickerProps {\n timeOptions: TimeOption[];\n value?: DurationString;\n onChange: (value: DurationString) => void;\n height?: string;\n}\n\nexport function RefreshIntervalPicker(props: RefreshIntervalPickerProps): ReactElement {\n const { value, onChange, timeOptions, height } = props;\n\n // If the dashboard refresh interval is not provided in timeOptions, it will create a specific option for the select\n const customInterval = useMemo(() => {\n if (value && !timeOptions.some((option) => option.value.pastDuration === value)) {\n return <MenuItem value={value}>{value}</MenuItem>;\n }\n }, [timeOptions, value]);\n\n return (\n <FormControl>\n <Box>\n <Select\n id=\"refreshInterval\"\n value={value}\n onChange={(event) => {\n const duration = event.target.value as DurationString;\n onChange(duration);\n }}\n inputProps={{\n 'aria-label': `Select refresh interval. Currently set to ${value}`,\n }}\n sx={{\n '.MuiSelect-select': height ? { lineHeight: height, paddingY: 0 } : {},\n }}\n >\n {timeOptions.map((item, idx) => (\n <MenuItem key={idx} value={item.value.pastDuration}>\n {item.display}\n </MenuItem>\n ))}\n {customInterval}\n </Select>\n </Box>\n </FormControl>\n );\n}\n"],"names":["Box","FormControl","MenuItem","Select"],"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,GAAG,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,gBAAgB;AAcnE,OAAO"}
|
|
@@ -11,58 +11,130 @@
|
|
|
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 { Box } from "@mui/material";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export function RepeatGrid(t0) {
|
|
17
|
+
const $ = _c(27);
|
|
18
|
+
const { repeatItems, maxPer, gap, renderItem, containerSx, rowSx } = t0;
|
|
19
|
+
const perRow = Math.max(1, maxPer);
|
|
20
|
+
let rows;
|
|
21
|
+
if ($[0] !== perRow || $[1] !== repeatItems) {
|
|
22
|
+
rows = [];
|
|
23
|
+
for(let i = 0; i < repeatItems.length; i = i + perRow, i){
|
|
21
24
|
rows.push(repeatItems.slice(i, i + perRow));
|
|
22
25
|
}
|
|
23
|
-
|
|
26
|
+
$[0] = perRow;
|
|
27
|
+
$[1] = repeatItems;
|
|
28
|
+
$[2] = rows;
|
|
29
|
+
} else {
|
|
30
|
+
rows = $[2];
|
|
31
|
+
}
|
|
32
|
+
let t1;
|
|
33
|
+
if ($[3] !== perRow || $[4] !== rows) {
|
|
34
|
+
t1 = {
|
|
24
35
|
rows,
|
|
25
36
|
perRow
|
|
26
37
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
38
|
+
$[3] = perRow;
|
|
39
|
+
$[4] = rows;
|
|
40
|
+
$[5] = t1;
|
|
41
|
+
} else {
|
|
42
|
+
t1 = $[5];
|
|
43
|
+
}
|
|
44
|
+
const { rows: rows_0, perRow: perRow_0 } = t1;
|
|
45
|
+
const t2 = `${gap}px`;
|
|
46
|
+
let t3;
|
|
47
|
+
if ($[6] !== t2) {
|
|
48
|
+
t3 = {
|
|
49
|
+
display: "flex",
|
|
50
|
+
flexDirection: "column",
|
|
51
|
+
width: "100%",
|
|
52
|
+
height: "100%",
|
|
53
|
+
gap: t2
|
|
54
|
+
};
|
|
55
|
+
$[6] = t2;
|
|
56
|
+
$[7] = t3;
|
|
57
|
+
} else {
|
|
58
|
+
t3 = $[7];
|
|
59
|
+
}
|
|
60
|
+
let t4;
|
|
61
|
+
if ($[8] !== containerSx) {
|
|
62
|
+
t4 = Array.isArray(containerSx) ? containerSx : [
|
|
63
|
+
containerSx
|
|
64
|
+
];
|
|
65
|
+
$[8] = containerSx;
|
|
66
|
+
$[9] = t4;
|
|
67
|
+
} else {
|
|
68
|
+
t4 = $[9];
|
|
69
|
+
}
|
|
70
|
+
let t5;
|
|
71
|
+
if ($[10] !== t3 || $[11] !== t4) {
|
|
72
|
+
t5 = [
|
|
73
|
+
t3,
|
|
74
|
+
...t4
|
|
75
|
+
];
|
|
76
|
+
$[10] = t3;
|
|
77
|
+
$[11] = t4;
|
|
78
|
+
$[12] = t5;
|
|
79
|
+
} else {
|
|
80
|
+
t5 = $[12];
|
|
81
|
+
}
|
|
82
|
+
let t6;
|
|
83
|
+
if ($[13] !== gap || $[14] !== perRow_0 || $[15] !== renderItem || $[16] !== rowSx || $[17] !== rows_0) {
|
|
84
|
+
let t7;
|
|
85
|
+
if ($[19] !== gap || $[20] !== perRow_0 || $[21] !== renderItem || $[22] !== rowSx) {
|
|
86
|
+
t7 = (rowItems, rowIndex)=>/*#__PURE__*/ _jsx(Box, {
|
|
87
|
+
sx: [
|
|
88
|
+
{
|
|
89
|
+
display: "flex",
|
|
90
|
+
gap: `${gap}px`
|
|
58
91
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
92
|
+
...Array.isArray(rowSx) ? rowSx : [
|
|
93
|
+
rowSx
|
|
94
|
+
]
|
|
95
|
+
],
|
|
96
|
+
children: rowItems.map((item, colIndex)=>/*#__PURE__*/ _jsx(Box, {
|
|
97
|
+
sx: {
|
|
98
|
+
width: `calc((100% - ${gap * (perRow_0 - 1)}px) / ${perRow_0})`,
|
|
99
|
+
overflow: "hidden"
|
|
100
|
+
},
|
|
101
|
+
children: renderItem(item, {
|
|
102
|
+
rowIndex,
|
|
103
|
+
colIndex
|
|
104
|
+
})
|
|
105
|
+
}, `${rowIndex}-${colIndex}`))
|
|
106
|
+
}, rowIndex);
|
|
107
|
+
$[19] = gap;
|
|
108
|
+
$[20] = perRow_0;
|
|
109
|
+
$[21] = renderItem;
|
|
110
|
+
$[22] = rowSx;
|
|
111
|
+
$[23] = t7;
|
|
112
|
+
} else {
|
|
113
|
+
t7 = $[23];
|
|
114
|
+
}
|
|
115
|
+
t6 = rows_0.map(t7);
|
|
116
|
+
$[13] = gap;
|
|
117
|
+
$[14] = perRow_0;
|
|
118
|
+
$[15] = renderItem;
|
|
119
|
+
$[16] = rowSx;
|
|
120
|
+
$[17] = rows_0;
|
|
121
|
+
$[18] = t6;
|
|
122
|
+
} else {
|
|
123
|
+
t6 = $[18];
|
|
124
|
+
}
|
|
125
|
+
let t7;
|
|
126
|
+
if ($[24] !== t5 || $[25] !== t6) {
|
|
127
|
+
t7 = /*#__PURE__*/ _jsx(Box, {
|
|
128
|
+
sx: t5,
|
|
129
|
+
children: t6
|
|
130
|
+
});
|
|
131
|
+
$[24] = t5;
|
|
132
|
+
$[25] = t6;
|
|
133
|
+
$[26] = t7;
|
|
134
|
+
} else {
|
|
135
|
+
t7 = $[26];
|
|
136
|
+
}
|
|
137
|
+
return t7;
|
|
66
138
|
}
|
|
67
139
|
|
|
68
140
|
//# sourceMappingURL=RepeatGrid.js.map
|