@perses-dev/components 0.55.0-rc.1 → 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/dist/utils/time-series-data.d.ts.map +1 -1
- package/dist/utils/time-series-data.js +5 -2
- package/dist/utils/time-series-data.js.map +1 -1
- package/package.json +13 -7
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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.
|
|
@@ -16,63 +17,157 @@ import CircleIcon from "mdi-material-ui/Circle";
|
|
|
16
17
|
import { useState } from "react";
|
|
17
18
|
import { useChartsTheme } from "../context/index.js";
|
|
18
19
|
import { ColorPicker } from "./ColorPicker.js";
|
|
19
|
-
export function OptionsColorPicker(
|
|
20
|
+
export function OptionsColorPicker(t0) {
|
|
21
|
+
const $ = _c(26);
|
|
22
|
+
const { label, color, size: t1, onColorChange, onClear } = t0;
|
|
23
|
+
const size = t1 === undefined ? "small" : t1;
|
|
20
24
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
21
25
|
const isOpen = Boolean(anchorEl);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
28
|
+
t2 = (event)=>{
|
|
29
|
+
setAnchorEl(event.currentTarget);
|
|
30
|
+
};
|
|
31
|
+
$[0] = t2;
|
|
32
|
+
} else {
|
|
33
|
+
t2 = $[0];
|
|
34
|
+
}
|
|
35
|
+
const openColorPicker = t2;
|
|
36
|
+
let t3;
|
|
37
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
38
|
+
t3 = ()=>{
|
|
39
|
+
setAnchorEl(null);
|
|
40
|
+
};
|
|
41
|
+
$[1] = t3;
|
|
42
|
+
} else {
|
|
43
|
+
t3 = $[1];
|
|
44
|
+
}
|
|
45
|
+
const closeColorPicker = t3;
|
|
46
|
+
const { thresholds: t4 } = useChartsTheme();
|
|
47
|
+
const { defaultColor, palette } = t4;
|
|
48
|
+
const t5 = `change ${label} color`;
|
|
49
|
+
let t6;
|
|
50
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
51
|
+
t6 = /*#__PURE__*/ _jsx(CircleIcon, {});
|
|
52
|
+
$[2] = t6;
|
|
53
|
+
} else {
|
|
54
|
+
t6 = $[2];
|
|
55
|
+
}
|
|
56
|
+
let t7;
|
|
57
|
+
if ($[3] !== color || $[4] !== isOpen || $[5] !== size || $[6] !== t5) {
|
|
58
|
+
t7 = /*#__PURE__*/ _jsx(ColorIconButton, {
|
|
59
|
+
size: size,
|
|
60
|
+
"aria-label": t5,
|
|
61
|
+
isSelected: isOpen,
|
|
62
|
+
iconColor: color,
|
|
63
|
+
onClick: openColorPicker,
|
|
64
|
+
children: t6
|
|
65
|
+
});
|
|
66
|
+
$[3] = color;
|
|
67
|
+
$[4] = isOpen;
|
|
68
|
+
$[5] = size;
|
|
69
|
+
$[6] = t5;
|
|
70
|
+
$[7] = t7;
|
|
71
|
+
} else {
|
|
72
|
+
t7 = $[7];
|
|
73
|
+
}
|
|
74
|
+
let t10;
|
|
75
|
+
let t8;
|
|
76
|
+
let t9;
|
|
77
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
78
|
+
t8 = {
|
|
79
|
+
paper: {
|
|
80
|
+
sx: {
|
|
81
|
+
padding: _temp
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
t9 = {
|
|
86
|
+
vertical: "top",
|
|
87
|
+
horizontal: "left"
|
|
88
|
+
};
|
|
89
|
+
t10 = {
|
|
90
|
+
vertical: "top",
|
|
91
|
+
horizontal: "right"
|
|
92
|
+
};
|
|
93
|
+
$[8] = t10;
|
|
94
|
+
$[9] = t8;
|
|
95
|
+
$[10] = t9;
|
|
96
|
+
} else {
|
|
97
|
+
t10 = $[8];
|
|
98
|
+
t8 = $[9];
|
|
99
|
+
t9 = $[10];
|
|
100
|
+
}
|
|
101
|
+
let t11;
|
|
102
|
+
if ($[11] !== defaultColor || $[12] !== palette) {
|
|
103
|
+
t11 = [
|
|
104
|
+
defaultColor,
|
|
105
|
+
...palette
|
|
106
|
+
];
|
|
107
|
+
$[11] = defaultColor;
|
|
108
|
+
$[12] = palette;
|
|
109
|
+
$[13] = t11;
|
|
110
|
+
} else {
|
|
111
|
+
t11 = $[13];
|
|
112
|
+
}
|
|
113
|
+
let t12;
|
|
114
|
+
if ($[14] !== color || $[15] !== onClear || $[16] !== onColorChange || $[17] !== t11) {
|
|
115
|
+
t12 = /*#__PURE__*/ _jsx(ColorPicker, {
|
|
116
|
+
color: color,
|
|
117
|
+
palette: t11,
|
|
118
|
+
onChange: onColorChange,
|
|
119
|
+
onClear: onClear
|
|
120
|
+
});
|
|
121
|
+
$[14] = color;
|
|
122
|
+
$[15] = onClear;
|
|
123
|
+
$[16] = onColorChange;
|
|
124
|
+
$[17] = t11;
|
|
125
|
+
$[18] = t12;
|
|
126
|
+
} else {
|
|
127
|
+
t12 = $[18];
|
|
128
|
+
}
|
|
129
|
+
let t13;
|
|
130
|
+
if ($[19] !== anchorEl || $[20] !== isOpen || $[21] !== t12) {
|
|
131
|
+
t13 = /*#__PURE__*/ _jsx(Popover, {
|
|
132
|
+
"data-testid": "options color picker",
|
|
133
|
+
open: isOpen,
|
|
134
|
+
anchorEl: anchorEl,
|
|
135
|
+
onClose: closeColorPicker,
|
|
136
|
+
slotProps: t8,
|
|
137
|
+
anchorOrigin: t9,
|
|
138
|
+
transformOrigin: t10,
|
|
139
|
+
children: t12
|
|
140
|
+
});
|
|
141
|
+
$[19] = anchorEl;
|
|
142
|
+
$[20] = isOpen;
|
|
143
|
+
$[21] = t12;
|
|
144
|
+
$[22] = t13;
|
|
145
|
+
} else {
|
|
146
|
+
t13 = $[22];
|
|
147
|
+
}
|
|
148
|
+
let t14;
|
|
149
|
+
if ($[23] !== t13 || $[24] !== t7) {
|
|
150
|
+
t14 = /*#__PURE__*/ _jsxs(_Fragment, {
|
|
151
|
+
children: [
|
|
152
|
+
t7,
|
|
153
|
+
t13
|
|
154
|
+
]
|
|
155
|
+
});
|
|
156
|
+
$[23] = t13;
|
|
157
|
+
$[24] = t7;
|
|
158
|
+
$[25] = t14;
|
|
159
|
+
} else {
|
|
160
|
+
t14 = $[25];
|
|
161
|
+
}
|
|
162
|
+
return t14;
|
|
163
|
+
}
|
|
164
|
+
function _temp(theme) {
|
|
165
|
+
return theme.spacing(2);
|
|
71
166
|
}
|
|
72
167
|
const ColorIconButton = styled(IconButton, {
|
|
73
|
-
shouldForwardProp: (props)=>props !==
|
|
168
|
+
shouldForwardProp: (props)=>props !== "isSelected" && props !== "iconColor"
|
|
74
169
|
})(({ iconColor, isSelected })=>({
|
|
75
|
-
backgroundColor: isSelected && iconColor ? `${iconColor}3F` :
|
|
170
|
+
backgroundColor: isSelected && iconColor ? `${iconColor}3F` : "undefined",
|
|
76
171
|
color: iconColor
|
|
77
172
|
}));
|
|
78
173
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ColorPicker/OptionsColorPicker.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 { styled, IconButton, Popover } from '@mui/material';\nimport CircleIcon from 'mdi-material-ui/Circle';\nimport type { ReactElement, MouseEvent } from 'react';\nimport { useState } from 'react';\n\nimport { useChartsTheme } from '../context';\nimport { ColorPicker } from './ColorPicker';\n\nexport interface OptionsColorPickerProps {\n label: string;\n color: string;\n size?: 'small' | 'medium' | 'large';\n onColorChange: (color: string) => void;\n onClear?: () => void;\n}\n\nexport function OptionsColorPicker({\n label,\n color,\n size = 'small',\n onColorChange,\n onClear,\n}: OptionsColorPickerProps): ReactElement {\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);\n const isOpen = Boolean(anchorEl);\n\n const openColorPicker = (event: MouseEvent<HTMLButtonElement>): void => {\n setAnchorEl(event.currentTarget);\n };\n\n const closeColorPicker = (): void => {\n setAnchorEl(null);\n };\n\n const {\n thresholds: { defaultColor, palette },\n } = useChartsTheme();\n\n return (\n <>\n <ColorIconButton\n size={size}\n aria-label={`change ${label} color`}\n isSelected={isOpen}\n iconColor={color}\n onClick={openColorPicker}\n >\n <CircleIcon />\n </ColorIconButton>\n <Popover\n data-testid=\"options color picker\"\n open={isOpen}\n anchorEl={anchorEl}\n onClose={closeColorPicker}\n slotProps={{ paper: { sx: { padding: (theme) => theme.spacing(2) } } }}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'left',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n >\n <ColorPicker color={color} palette={[defaultColor, ...palette]} onChange={onColorChange} onClear={onClear} />\n </Popover>\n </>\n );\n}\n\nconst ColorIconButton = styled(IconButton, {\n shouldForwardProp: (props) => props !== 'isSelected' && props !== 'iconColor',\n})<{\n iconColor?: string;\n isSelected?: boolean;\n}>(({ iconColor, isSelected }) => ({\n backgroundColor: isSelected && iconColor ? `${iconColor}3F` : 'undefined', // 3F represents 25% opacity\n color: iconColor,\n}));\n"],"names":["styled","IconButton","Popover","CircleIcon","useState","useChartsTheme","ColorPicker","
|
|
1
|
+
{"version":3,"sources":["../../src/ColorPicker/OptionsColorPicker.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 { styled, IconButton, Popover } from '@mui/material';\nimport CircleIcon from 'mdi-material-ui/Circle';\nimport type { ReactElement, MouseEvent } from 'react';\nimport { useState } from 'react';\n\nimport { useChartsTheme } from '../context';\nimport { ColorPicker } from './ColorPicker';\n\nexport interface OptionsColorPickerProps {\n label: string;\n color: string;\n size?: 'small' | 'medium' | 'large';\n onColorChange: (color: string) => void;\n onClear?: () => void;\n}\n\nexport function OptionsColorPicker({\n label,\n color,\n size = 'small',\n onColorChange,\n onClear,\n}: OptionsColorPickerProps): ReactElement {\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);\n const isOpen = Boolean(anchorEl);\n\n const openColorPicker = (event: MouseEvent<HTMLButtonElement>): void => {\n setAnchorEl(event.currentTarget);\n };\n\n const closeColorPicker = (): void => {\n setAnchorEl(null);\n };\n\n const {\n thresholds: { defaultColor, palette },\n } = useChartsTheme();\n\n return (\n <>\n <ColorIconButton\n size={size}\n aria-label={`change ${label} color`}\n isSelected={isOpen}\n iconColor={color}\n onClick={openColorPicker}\n >\n <CircleIcon />\n </ColorIconButton>\n <Popover\n data-testid=\"options color picker\"\n open={isOpen}\n anchorEl={anchorEl}\n onClose={closeColorPicker}\n slotProps={{ paper: { sx: { padding: (theme) => theme.spacing(2) } } }}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'left',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n >\n <ColorPicker color={color} palette={[defaultColor, ...palette]} onChange={onColorChange} onClear={onClear} />\n </Popover>\n </>\n );\n}\n\nconst ColorIconButton = styled(IconButton, {\n shouldForwardProp: (props) => props !== 'isSelected' && props !== 'iconColor',\n})<{\n iconColor?: string;\n isSelected?: boolean;\n}>(({ iconColor, isSelected }) => ({\n backgroundColor: isSelected && iconColor ? `${iconColor}3F` : 'undefined', // 3F represents 25% opacity\n color: iconColor,\n}));\n"],"names":["styled","IconButton","Popover","CircleIcon","useState","useChartsTheme","ColorPicker","ColorIconButton","shouldForwardProp","props","iconColor","isSelected","backgroundColor","color"],"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,MAAM,EAAEC,UAAU,EAAEC,OAAO,QAAQ,gBAAgB;AAC5D,OAAOC,gBAAgB,yBAAyB;AAEhD,SAASC,QAAQ,QAAQ,QAAQ;AAEjC,SAASC,cAAc,QAAQ,sBAAa;AAC5C,SAASC,WAAW,QAAQ,mBAAgB;AAU5C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDP,MAAMC,kBAAkBP,OAAOC,YAAY;IACzCO,mBAAmB,CAACC,QAAUA,UAAU,gBAAgBA,UAAU;AACpE,GAGG,CAAC,EAAEC,SAAS,EAAEC,UAAU,EAAE,GAAM,CAAA;QACjCC,iBAAiBD,cAAcD,YAAY,GAAGA,UAAU,EAAE,CAAC,GAAG;QAC9DG,OAAOH;IACT,CAAA"}
|
|
@@ -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.
|
|
@@ -21,49 +22,151 @@ import { getContentWithLegendLayout } from "./model/content-with-legend-model.js
|
|
|
21
22
|
*
|
|
22
23
|
* See the documentation for the `Legend` component for more details about the
|
|
23
24
|
* features and configuration of the legend.
|
|
24
|
-
*/ export function ContentWithLegend(
|
|
25
|
+
*/ export function ContentWithLegend(t0) {
|
|
26
|
+
const $ = _c(38);
|
|
27
|
+
const { children, legendProps, width, height, spacing: t1, legendSize, minChildrenWidth: t2, minChildrenHeight: t3 } = t0;
|
|
28
|
+
const spacing = t1 === undefined ? 0 : t1;
|
|
29
|
+
const minChildrenWidth = t2 === undefined ? 100 : t2;
|
|
30
|
+
const minChildrenHeight = t3 === undefined ? 100 : t3;
|
|
25
31
|
const theme = useTheme();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return /*#__PURE__*/ _jsxs(Box, {
|
|
37
|
-
style: {
|
|
32
|
+
let T0;
|
|
33
|
+
let T1;
|
|
34
|
+
let legend;
|
|
35
|
+
let t4;
|
|
36
|
+
let t5;
|
|
37
|
+
let t6;
|
|
38
|
+
let t7;
|
|
39
|
+
let t8;
|
|
40
|
+
if ($[0] !== children || $[1] !== height || $[2] !== legendProps || $[3] !== legendSize || $[4] !== minChildrenHeight || $[5] !== minChildrenWidth || $[6] !== spacing || $[7] !== theme || $[8] !== width) {
|
|
41
|
+
const { content, legend: t9, margin } = getContentWithLegendLayout({
|
|
38
42
|
width,
|
|
39
|
-
height
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
43
|
+
height,
|
|
44
|
+
legendProps,
|
|
45
|
+
minChildrenHeight,
|
|
46
|
+
minChildrenWidth,
|
|
47
|
+
spacing,
|
|
48
|
+
theme,
|
|
49
|
+
legendSize: getLegendSize(legendSize)
|
|
50
|
+
});
|
|
51
|
+
legend = t9;
|
|
52
|
+
T1 = Box;
|
|
53
|
+
if ($[17] !== height || $[18] !== width) {
|
|
54
|
+
t7 = {
|
|
55
|
+
width,
|
|
56
|
+
height
|
|
57
|
+
};
|
|
58
|
+
$[17] = height;
|
|
59
|
+
$[18] = width;
|
|
60
|
+
$[19] = t7;
|
|
61
|
+
} else {
|
|
62
|
+
t7 = $[19];
|
|
63
|
+
}
|
|
64
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
65
|
+
t8 = {
|
|
66
|
+
position: "relative",
|
|
67
|
+
overflow: "hidden"
|
|
68
|
+
};
|
|
69
|
+
$[20] = t8;
|
|
70
|
+
} else {
|
|
71
|
+
t8 = $[20];
|
|
72
|
+
}
|
|
73
|
+
T0 = Box;
|
|
74
|
+
t4 = {
|
|
75
|
+
width: content.width,
|
|
76
|
+
height: content.height
|
|
77
|
+
};
|
|
78
|
+
const t10 = `${margin.right}px`;
|
|
79
|
+
const t11 = `${margin.bottom}px`;
|
|
80
|
+
if ($[21] !== t10 || $[22] !== t11) {
|
|
81
|
+
t5 = {
|
|
82
|
+
marginRight: t10,
|
|
83
|
+
marginBottom: t11
|
|
84
|
+
};
|
|
85
|
+
$[21] = t10;
|
|
86
|
+
$[22] = t11;
|
|
87
|
+
$[23] = t5;
|
|
88
|
+
} else {
|
|
89
|
+
t5 = $[23];
|
|
90
|
+
}
|
|
91
|
+
t6 = typeof children === "function" ? children({
|
|
92
|
+
width: content.width,
|
|
93
|
+
height: content.height
|
|
94
|
+
}) : children;
|
|
95
|
+
$[0] = children;
|
|
96
|
+
$[1] = height;
|
|
97
|
+
$[2] = legendProps;
|
|
98
|
+
$[3] = legendSize;
|
|
99
|
+
$[4] = minChildrenHeight;
|
|
100
|
+
$[5] = minChildrenWidth;
|
|
101
|
+
$[6] = spacing;
|
|
102
|
+
$[7] = theme;
|
|
103
|
+
$[8] = width;
|
|
104
|
+
$[9] = T0;
|
|
105
|
+
$[10] = T1;
|
|
106
|
+
$[11] = legend;
|
|
107
|
+
$[12] = t4;
|
|
108
|
+
$[13] = t5;
|
|
109
|
+
$[14] = t6;
|
|
110
|
+
$[15] = t7;
|
|
111
|
+
$[16] = t8;
|
|
112
|
+
} else {
|
|
113
|
+
T0 = $[9];
|
|
114
|
+
T1 = $[10];
|
|
115
|
+
legend = $[11];
|
|
116
|
+
t4 = $[12];
|
|
117
|
+
t5 = $[13];
|
|
118
|
+
t6 = $[14];
|
|
119
|
+
t7 = $[15];
|
|
120
|
+
t8 = $[16];
|
|
121
|
+
}
|
|
122
|
+
let t9;
|
|
123
|
+
if ($[24] !== T0 || $[25] !== t4 || $[26] !== t5 || $[27] !== t6) {
|
|
124
|
+
t9 = /*#__PURE__*/ _jsx(T0, {
|
|
125
|
+
style: t4,
|
|
126
|
+
sx: t5,
|
|
127
|
+
children: t6
|
|
128
|
+
});
|
|
129
|
+
$[24] = T0;
|
|
130
|
+
$[25] = t4;
|
|
131
|
+
$[26] = t5;
|
|
132
|
+
$[27] = t6;
|
|
133
|
+
$[28] = t9;
|
|
134
|
+
} else {
|
|
135
|
+
t9 = $[28];
|
|
136
|
+
}
|
|
137
|
+
let t10;
|
|
138
|
+
if ($[29] !== legend || $[30] !== legendProps) {
|
|
139
|
+
t10 = legendProps && legend.show && /*#__PURE__*/ _jsx(Legend, {
|
|
140
|
+
...legendProps,
|
|
141
|
+
height: legend.height,
|
|
142
|
+
width: legend.width
|
|
143
|
+
});
|
|
144
|
+
$[29] = legend;
|
|
145
|
+
$[30] = legendProps;
|
|
146
|
+
$[31] = t10;
|
|
147
|
+
} else {
|
|
148
|
+
t10 = $[31];
|
|
149
|
+
}
|
|
150
|
+
let t11;
|
|
151
|
+
if ($[32] !== T1 || $[33] !== t10 || $[34] !== t7 || $[35] !== t8 || $[36] !== t9) {
|
|
152
|
+
t11 = /*#__PURE__*/ _jsxs(T1, {
|
|
153
|
+
style: t7,
|
|
154
|
+
sx: t8,
|
|
155
|
+
children: [
|
|
156
|
+
t9,
|
|
157
|
+
t10
|
|
158
|
+
]
|
|
159
|
+
});
|
|
160
|
+
$[32] = T1;
|
|
161
|
+
$[33] = t10;
|
|
162
|
+
$[34] = t7;
|
|
163
|
+
$[35] = t8;
|
|
164
|
+
$[36] = t9;
|
|
165
|
+
$[37] = t11;
|
|
166
|
+
} else {
|
|
167
|
+
t11 = $[37];
|
|
168
|
+
}
|
|
169
|
+
return t11;
|
|
67
170
|
}
|
|
68
171
|
|
|
69
172
|
//# sourceMappingURL=ContentWithLegend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ContentWithLegend/ContentWithLegend.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, useTheme } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport { Legend } from '../Legend';\nimport { getLegendSize } from '../model';\nimport type { ContentWithLegendProps } from './model/content-with-legend-model';\nimport { getContentWithLegendLayout } from './model/content-with-legend-model';\n\n/**\n * Component to help lay out content alongside a `Legend` component based on the\n * configuration of the legend.\n *\n * See the documentation for the `Legend` component for more details about the\n * features and configuration of the legend.\n */\nexport function ContentWithLegend({\n children,\n legendProps,\n width,\n height,\n spacing = 0,\n legendSize,\n minChildrenWidth = 100,\n minChildrenHeight = 100,\n}: ContentWithLegendProps): ReactElement {\n const theme = useTheme();\n const { content, legend, margin } = getContentWithLegendLayout({\n width,\n height,\n legendProps,\n minChildrenHeight,\n minChildrenWidth,\n spacing,\n theme,\n legendSize: getLegendSize(legendSize),\n });\n\n return (\n <Box\n style={{\n width,\n height,\n }}\n sx={{\n position: 'relative',\n overflow: 'hidden',\n }}\n >\n <Box\n style={{\n width: content.width,\n height: content.height,\n }}\n sx={{\n marginRight: `${margin.right}px`,\n marginBottom: `${margin.bottom}px`,\n }}\n >\n {typeof children === 'function' ? children({ width: content.width, height: content.height }) : children}\n </Box>\n {legendProps && legend.show && <Legend {...legendProps} height={legend.height} width={legend.width} />}\n </Box>\n );\n}\n"],"names":["Box","useTheme","Legend","getLegendSize","getContentWithLegendLayout"
|
|
1
|
+
{"version":3,"sources":["../../src/ContentWithLegend/ContentWithLegend.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, useTheme } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport { Legend } from '../Legend';\nimport { getLegendSize } from '../model';\nimport type { ContentWithLegendProps } from './model/content-with-legend-model';\nimport { getContentWithLegendLayout } from './model/content-with-legend-model';\n\n/**\n * Component to help lay out content alongside a `Legend` component based on the\n * configuration of the legend.\n *\n * See the documentation for the `Legend` component for more details about the\n * features and configuration of the legend.\n */\nexport function ContentWithLegend({\n children,\n legendProps,\n width,\n height,\n spacing = 0,\n legendSize,\n minChildrenWidth = 100,\n minChildrenHeight = 100,\n}: ContentWithLegendProps): ReactElement {\n const theme = useTheme();\n const { content, legend, margin } = getContentWithLegendLayout({\n width,\n height,\n legendProps,\n minChildrenHeight,\n minChildrenWidth,\n spacing,\n theme,\n legendSize: getLegendSize(legendSize),\n });\n\n return (\n <Box\n style={{\n width,\n height,\n }}\n sx={{\n position: 'relative',\n overflow: 'hidden',\n }}\n >\n <Box\n style={{\n width: content.width,\n height: content.height,\n }}\n sx={{\n marginRight: `${margin.right}px`,\n marginBottom: `${margin.bottom}px`,\n }}\n >\n {typeof children === 'function' ? children({ width: content.width, height: content.height }) : children}\n </Box>\n {legendProps && legend.show && <Legend {...legendProps} height={legend.height} width={legend.width} />}\n </Box>\n );\n}\n"],"names":["Box","useTheme","Legend","getLegendSize","getContentWithLegendLayout"],"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,QAAQ,QAAQ,gBAAgB;AAG9C,SAASC,MAAM,QAAQ,qBAAY;AACnC,SAASC,aAAa,QAAQ,oBAAW;AAEzC,SAASC,0BAA0B,QAAQ,uCAAoC;AAE/E;;;;;;CAMC,GACD,OAAO"}
|
|
@@ -11,36 +11,69 @@
|
|
|
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 { OptionsEditorControl } from "../OptionsEditorLayout/index.js";
|
|
15
16
|
import { SettingsAutocomplete } from "../SettingsAutocomplete/index.js";
|
|
16
17
|
const DENSITY_OPTIONS = [
|
|
17
18
|
{
|
|
18
|
-
id:
|
|
19
|
-
label:
|
|
19
|
+
id: "compact",
|
|
20
|
+
label: "Compact"
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
|
-
id:
|
|
23
|
-
label:
|
|
23
|
+
id: "standard",
|
|
24
|
+
label: "Standard"
|
|
24
25
|
},
|
|
25
26
|
{
|
|
26
|
-
id:
|
|
27
|
-
label:
|
|
27
|
+
id: "comfortable",
|
|
28
|
+
label: "Comfortable"
|
|
28
29
|
}
|
|
29
30
|
];
|
|
30
|
-
export function DensitySelector(
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
export function DensitySelector(t0) {
|
|
32
|
+
const $ = _c(7);
|
|
33
|
+
const { onChange, value: t1 } = t0;
|
|
34
|
+
const value = t1 === undefined ? "standard" : t1;
|
|
35
|
+
let t2;
|
|
36
|
+
if ($[0] !== onChange) {
|
|
37
|
+
t2 = (_, t3)=>{
|
|
38
|
+
const { id } = t3;
|
|
39
|
+
onChange(id);
|
|
40
|
+
};
|
|
41
|
+
$[0] = onChange;
|
|
42
|
+
$[1] = t2;
|
|
43
|
+
} else {
|
|
44
|
+
t2 = $[1];
|
|
45
|
+
}
|
|
46
|
+
const handleSortChange = t2;
|
|
47
|
+
let t3;
|
|
48
|
+
if ($[2] !== value) {
|
|
49
|
+
t3 = DENSITY_OPTIONS.find((o)=>o.id === value);
|
|
50
|
+
$[2] = value;
|
|
51
|
+
$[3] = t3;
|
|
52
|
+
} else {
|
|
53
|
+
t3 = $[3];
|
|
54
|
+
}
|
|
55
|
+
let t4;
|
|
56
|
+
if ($[4] !== handleSortChange || $[5] !== t3) {
|
|
57
|
+
t4 = /*#__PURE__*/ _jsx(OptionsEditorControl, {
|
|
58
|
+
label: "Density",
|
|
59
|
+
control: /*#__PURE__*/ _jsx(SettingsAutocomplete, {
|
|
60
|
+
value: t3,
|
|
61
|
+
options: DENSITY_OPTIONS,
|
|
62
|
+
getOptionLabel: _temp,
|
|
63
|
+
onChange: handleSortChange,
|
|
64
|
+
disableClearable: true
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
$[4] = handleSortChange;
|
|
68
|
+
$[5] = t3;
|
|
69
|
+
$[6] = t4;
|
|
70
|
+
} else {
|
|
71
|
+
t4 = $[6];
|
|
72
|
+
}
|
|
73
|
+
return t4;
|
|
74
|
+
}
|
|
75
|
+
function _temp(o_0) {
|
|
76
|
+
return o_0.label;
|
|
44
77
|
}
|
|
45
78
|
|
|
46
79
|
//# sourceMappingURL=DensitySelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/DensitySelector/DensitySelector.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 { ReactElement } from 'react';\n\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst DENSITY_OPTIONS: Array<{ id: DensityOption; label: string }> = [\n { id: 'compact', label: 'Compact' },\n { id: 'standard', label: 'Standard' },\n { id: 'comfortable', label: 'Comfortable' },\n];\n\nexport type DensityOption = 'compact' | 'standard' | 'comfortable';\n\nexport interface DensitySelectorProps {\n onChange: (density: DensityOption) => void;\n value?: DensityOption;\n}\n\nexport function DensitySelector({ onChange, value = 'standard' }: DensitySelectorProps): ReactElement {\n const handleSortChange = (_: unknown, { id }: { id: DensityOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Density\"\n control={\n <SettingsAutocomplete\n value={DENSITY_OPTIONS.find((o) => o.id === value)}\n options={DENSITY_OPTIONS}\n getOptionLabel={(o) => o.label}\n onChange={handleSortChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","DENSITY_OPTIONS","id","label"
|
|
1
|
+
{"version":3,"sources":["../../src/DensitySelector/DensitySelector.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 { ReactElement } from 'react';\n\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst DENSITY_OPTIONS: Array<{ id: DensityOption; label: string }> = [\n { id: 'compact', label: 'Compact' },\n { id: 'standard', label: 'Standard' },\n { id: 'comfortable', label: 'Comfortable' },\n];\n\nexport type DensityOption = 'compact' | 'standard' | 'comfortable';\n\nexport interface DensitySelectorProps {\n onChange: (density: DensityOption) => void;\n value?: DensityOption;\n}\n\nexport function DensitySelector({ onChange, value = 'standard' }: DensitySelectorProps): ReactElement {\n const handleSortChange = (_: unknown, { id }: { id: DensityOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Density\"\n control={\n <SettingsAutocomplete\n value={DENSITY_OPTIONS.find((o) => o.id === value)}\n options={DENSITY_OPTIONS}\n getOptionLabel={(o) => o.label}\n onChange={handleSortChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","DENSITY_OPTIONS","id","label"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;;AAIjC,SAASA,oBAAoB,QAAQ,kCAAyB;AAC9D,SAASC,oBAAoB,QAAQ,mCAA0B;AAE/D,MAAMC,kBAA+D;IACnE;QAAEC,IAAI;QAAWC,OAAO;IAAU;IAClC;QAAED,IAAI;QAAYC,OAAO;IAAW;IACpC;QAAED,IAAI;QAAeC,OAAO;IAAc;CAC3C;AASD,OAAO"}
|
package/dist/Dialog/Dialog.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { StyledComponent } from '@emotion/styled';
|
|
2
|
-
import type { ButtonProps, DialogProps, DialogTitleProps, DialogContentProps as MuiDialogContentProps } from '@mui/material';
|
|
2
|
+
import type { ButtonProps, DialogProps, DialogTitleProps, DialogContentProps as MuiDialogContentProps, Theme } from '@mui/material';
|
|
3
3
|
import { DialogActions } from '@mui/material';
|
|
4
|
+
import type { MUIStyledCommonProps } from '@mui/system';
|
|
4
5
|
import type { MouseEvent, ReactElement } from 'react';
|
|
5
6
|
export interface DialogHeaderProps extends DialogTitleProps {
|
|
6
7
|
/**
|
|
@@ -14,7 +15,7 @@ declare const Header: ({ children, onClose, ...props }: DialogHeaderProps) => Re
|
|
|
14
15
|
declare const Content: ({ children, sx, ...props }: DialogContentProps) => ReactElement;
|
|
15
16
|
declare const PrimaryButton: ({ children, ...props }: DialogButtonProps) => ReactElement;
|
|
16
17
|
declare const SecondaryButton: ({ children, ...props }: DialogButtonProps) => ReactElement;
|
|
17
|
-
declare const Form: StyledComponent<React.ComponentProps<'form'>>;
|
|
18
|
+
declare const Form: StyledComponent<MUIStyledCommonProps<Theme>, React.ComponentProps<'form'>>;
|
|
18
19
|
export declare const Dialog: React.FC<DialogProps> & {
|
|
19
20
|
Header: typeof Header;
|
|
20
21
|
Form: typeof Form;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,kBAAkB,IAAI,qBAAqB,
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,kBAAkB,IAAI,qBAAqB,EAC3C,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,aAAa,EAMd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAItD,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;AAEhF,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAEvD,QAAA,MAAM,MAAM,oCAAqC,iBAAiB,KAAG,YAapE,CAAC;AAEF,QAAA,MAAM,OAAO,+BAAgC,kBAAkB,KAAG,YAIjE,CAAC;AAEF,QAAA,MAAM,aAAa,2BAA4B,iBAAiB,KAAG,YAIlE,CAAC;AAEF,QAAA,MAAM,eAAe,2BAA4B,iBAAiB,KAAG,YAIpE,CAAC;AAQF,QAAA,MAAM,IAAI,EAAE,eAAe,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAInF,CAAC;AAUH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG;IAC3C,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,OAAO,EAAE,OAAO,aAAa,CAAC;CAC4C,CAAC"}
|