@perses-dev/components 0.46.0 → 0.47.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.d.ts +8 -0
- package/dist/AlignSelector/AlignSelector.d.ts.map +1 -0
- package/dist/AlignSelector/AlignSelector.js +45 -0
- package/dist/AlignSelector/AlignSelector.js.map +1 -0
- package/dist/AlignSelector/index.d.ts +2 -0
- package/dist/AlignSelector/index.d.ts.map +1 -0
- package/dist/AlignSelector/index.js +15 -0
- package/dist/AlignSelector/index.js.map +1 -0
- package/dist/ColorPicker/OptionsColorPicker.d.ts +7 -0
- package/dist/ColorPicker/OptionsColorPicker.d.ts.map +1 -0
- package/dist/{ThresholdsEditor/ThresholdColorPicker.js → ColorPicker/OptionsColorPicker.js} +5 -5
- package/dist/ColorPicker/OptionsColorPicker.js.map +1 -0
- package/dist/ColorPicker/index.d.ts +1 -0
- package/dist/ColorPicker/index.d.ts.map +1 -1
- package/dist/ColorPicker/index.js +1 -0
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/DensitySelector/DensitySelector.d.ts +7 -0
- package/dist/DensitySelector/DensitySelector.d.ts.map +1 -0
- package/dist/DensitySelector/DensitySelector.js +46 -0
- package/dist/DensitySelector/DensitySelector.js.map +1 -0
- package/dist/DensitySelector/index.d.ts +2 -0
- package/dist/DensitySelector/index.d.ts.map +1 -0
- package/dist/DensitySelector/index.js +15 -0
- package/dist/DensitySelector/index.js.map +1 -0
- package/dist/Dialog/Dialog.d.ts +2 -7
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +7 -2
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/LinksEditor/LinksEditor.d.ts +6 -1
- package/dist/LinksEditor/LinksEditor.d.ts.map +1 -1
- package/dist/LinksEditor/LinksEditor.js +15 -8
- package/dist/LinksEditor/LinksEditor.js.map +1 -1
- package/dist/Overlay/Overlay.d.ts +15 -0
- package/dist/Overlay/Overlay.d.ts.map +1 -0
- package/dist/Overlay/Overlay.js +52 -0
- package/dist/Overlay/Overlay.js.map +1 -0
- package/dist/Overlay/index.d.ts +2 -0
- package/dist/Overlay/index.d.ts.map +1 -0
- package/dist/Overlay/index.js +15 -0
- package/dist/Overlay/index.js.map +1 -0
- package/dist/SortSelector/SortSelectorButtons.d.ts +8 -0
- package/dist/SortSelector/SortSelectorButtons.d.ts.map +1 -0
- package/dist/SortSelector/SortSelectorButtons.js +45 -0
- package/dist/SortSelector/SortSelectorButtons.js.map +1 -0
- package/dist/SortSelector/index.d.ts +1 -0
- package/dist/SortSelector/index.d.ts.map +1 -1
- package/dist/SortSelector/index.js +2 -1
- package/dist/SortSelector/index.js.map +1 -1
- package/dist/Table/InnerTable.d.ts.map +1 -1
- package/dist/Table/InnerTable.js +2 -1
- package/dist/Table/InnerTable.js.map +1 -1
- package/dist/Table/TableCell.d.ts +1 -1
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +3 -1
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableHeaderCell.d.ts +1 -1
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/model/table-model.d.ts +1 -1
- package/dist/Table/model/table-model.d.ts.map +1 -1
- package/dist/Table/model/table-model.js +25 -20
- package/dist/Table/model/table-model.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js +2 -2
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +2 -2
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts +18 -0
- package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts.map +1 -0
- package/dist/{DateTimeRangePicker/AbsoluteTimePicker.js → TimeRangeSelector/DateTimeRangePicker.js} +45 -28
- package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +35 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.js +119 -0
- package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -0
- package/dist/{DateTimeRangePicker → TimeRangeSelector}/index.d.ts +1 -2
- package/dist/TimeRangeSelector/index.d.ts.map +1 -0
- package/dist/{DateTimeRangePicker → TimeRangeSelector}/index.js +2 -3
- package/dist/TimeRangeSelector/index.js.map +1 -0
- package/dist/TimeRangeSelector/utils.d.ts +25 -0
- package/dist/TimeRangeSelector/utils.d.ts.map +1 -0
- package/dist/{DateTimeRangePicker → TimeRangeSelector}/utils.js +23 -2
- package/dist/TimeRangeSelector/utils.js.map +1 -0
- package/dist/cjs/AlignSelector/AlignSelector.js +53 -0
- package/dist/cjs/AlignSelector/index.js +30 -0
- package/dist/cjs/{ThresholdsEditor/ThresholdColorPicker.js → ColorPicker/OptionsColorPicker.js} +6 -6
- package/dist/cjs/ColorPicker/index.js +1 -0
- package/dist/cjs/DensitySelector/DensitySelector.js +54 -0
- package/dist/cjs/DensitySelector/index.js +30 -0
- package/dist/cjs/Dialog/Dialog.js +7 -2
- package/dist/cjs/LinksEditor/LinksEditor.js +15 -8
- package/dist/cjs/Overlay/Overlay.js +71 -0
- package/dist/cjs/Overlay/index.js +30 -0
- package/dist/cjs/SortSelector/SortSelectorButtons.js +53 -0
- package/dist/cjs/SortSelector/index.js +2 -1
- package/dist/cjs/Table/InnerTable.js +2 -1
- package/dist/cjs/Table/TableCell.js +3 -1
- package/dist/cjs/Table/model/table-model.js +25 -20
- package/dist/cjs/ThresholdsEditor/ThresholdInput.js +2 -2
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +2 -2
- package/dist/cjs/{DateTimeRangePicker/AbsoluteTimePicker.js → TimeRangeSelector/DateTimeRangePicker.js} +39 -30
- package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +127 -0
- package/dist/cjs/{DateTimeRangePicker → TimeRangeSelector}/index.js +2 -3
- package/dist/cjs/{DateTimeRangePicker → TimeRangeSelector}/utils.js +24 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/model/timeOption.js +19 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/model/timeOption.d.ts +2 -1
- package/dist/model/timeOption.d.ts.map +1 -1
- package/dist/model/timeOption.js +13 -2
- package/dist/model/timeOption.js.map +1 -1
- package/package.json +7 -6
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +0 -9
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +0 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +0 -11
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +0 -80
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +0 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts +0 -13
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js +0 -67
- package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +0 -1
- package/dist/DateTimeRangePicker/index.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/index.js.map +0 -1
- package/dist/DateTimeRangePicker/utils.d.ts +0 -7
- package/dist/DateTimeRangePicker/utils.d.ts.map +0 -1
- package/dist/DateTimeRangePicker/utils.js.map +0 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +0 -3
- package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +0 -1
- package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +0 -1
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +0 -88
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +0 -80
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License | Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing | software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS |
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND | either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "DensitySelector", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return DensitySelector;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _OptionsEditorLayout = require("../OptionsEditorLayout");
|
|
25
|
+
const _SettingsAutocomplete = require("../SettingsAutocomplete");
|
|
26
|
+
const DENSITY_OPTIONS = [
|
|
27
|
+
{
|
|
28
|
+
id: 'compact',
|
|
29
|
+
label: 'Compact'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'standard',
|
|
33
|
+
label: 'Standard'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'comfortable',
|
|
37
|
+
label: 'Comfortable'
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
function DensitySelector({ onChange, value = 'standard' }) {
|
|
41
|
+
const handleSortChange = (_, { id })=>{
|
|
42
|
+
onChange(id);
|
|
43
|
+
};
|
|
44
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorLayout.OptionsEditorControl, {
|
|
45
|
+
label: "Density",
|
|
46
|
+
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_SettingsAutocomplete.SettingsAutocomplete, {
|
|
47
|
+
value: DENSITY_OPTIONS.find((o)=>o.id === value),
|
|
48
|
+
options: DENSITY_OPTIONS,
|
|
49
|
+
getOptionLabel: (o)=>o.label,
|
|
50
|
+
onChange: handleSortChange,
|
|
51
|
+
disableClearable: true
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_export_star(require("./DensitySelector"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return from;
|
|
30
|
+
}
|
|
@@ -34,6 +34,10 @@ const Header = ({ children, onClose, ...props })=>{
|
|
|
34
34
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
35
35
|
children: [
|
|
36
36
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.DialogTitle, {
|
|
37
|
+
style: {
|
|
38
|
+
textOverflow: 'ellipsis',
|
|
39
|
+
overflow: 'hidden'
|
|
40
|
+
},
|
|
37
41
|
...props,
|
|
38
42
|
children: children
|
|
39
43
|
}),
|
|
@@ -46,11 +50,12 @@ const Header = ({ children, onClose, ...props })=>{
|
|
|
46
50
|
]
|
|
47
51
|
});
|
|
48
52
|
};
|
|
49
|
-
const Content = ({ children,
|
|
53
|
+
const Content = ({ children, sx, ...props })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.DialogContent, {
|
|
50
54
|
dividers: true,
|
|
51
55
|
...props,
|
|
52
56
|
sx: (0, _utils.combineSx)({
|
|
53
|
-
|
|
57
|
+
minWidth: `500px`,
|
|
58
|
+
textWrap: 'balance'
|
|
54
59
|
}, sx),
|
|
55
60
|
children: children
|
|
56
61
|
});
|
|
@@ -72,9 +72,10 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
72
72
|
}
|
|
73
73
|
return newObj;
|
|
74
74
|
}
|
|
75
|
-
function LinksEditor({ ...props }) {
|
|
75
|
+
function LinksEditor({ control, ...props }) {
|
|
76
76
|
const { fields, append, remove } = (0, _reacthookform.useFieldArray)({
|
|
77
|
-
|
|
77
|
+
control: control,
|
|
78
|
+
name: 'panelDefinition.spec.links'
|
|
78
79
|
});
|
|
79
80
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
80
81
|
...props,
|
|
@@ -88,6 +89,7 @@ function LinksEditor({ ...props }) {
|
|
|
88
89
|
alignItems: "center",
|
|
89
90
|
children: [
|
|
90
91
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(LinkControl, {
|
|
92
|
+
control: control,
|
|
91
93
|
index: index
|
|
92
94
|
}),
|
|
93
95
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
@@ -121,7 +123,7 @@ function LinksEditor({ ...props }) {
|
|
|
121
123
|
]
|
|
122
124
|
});
|
|
123
125
|
}
|
|
124
|
-
function LinkControl({ index }) {
|
|
126
|
+
function LinkControl({ control, index }) {
|
|
125
127
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
126
128
|
gap: 2,
|
|
127
129
|
flexGrow: 1,
|
|
@@ -131,7 +133,8 @@ function LinkControl({ index }) {
|
|
|
131
133
|
gap: 2,
|
|
132
134
|
children: [
|
|
133
135
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
134
|
-
|
|
136
|
+
control: control,
|
|
137
|
+
name: `panelDefinition.spec.links.${index}.url`,
|
|
135
138
|
render: ({ field, fieldState })=>{
|
|
136
139
|
var _fieldState_error;
|
|
137
140
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
@@ -148,7 +151,8 @@ function LinkControl({ index }) {
|
|
|
148
151
|
}
|
|
149
152
|
}),
|
|
150
153
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
151
|
-
|
|
154
|
+
control: control,
|
|
155
|
+
name: `panelDefinition.spec.links.${index}.name`,
|
|
152
156
|
render: ({ field, fieldState })=>{
|
|
153
157
|
var _fieldState_error;
|
|
154
158
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
@@ -165,7 +169,8 @@ function LinkControl({ index }) {
|
|
|
165
169
|
}
|
|
166
170
|
}),
|
|
167
171
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
168
|
-
|
|
172
|
+
control: control,
|
|
173
|
+
name: `panelDefinition.spec.links.${index}.tooltip`,
|
|
169
174
|
render: ({ field, fieldState })=>{
|
|
170
175
|
var _fieldState_error;
|
|
171
176
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
@@ -189,7 +194,8 @@ function LinkControl({ index }) {
|
|
|
189
194
|
alignItems: "center",
|
|
190
195
|
children: [
|
|
191
196
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
192
|
-
|
|
197
|
+
control: control,
|
|
198
|
+
name: `panelDefinition.spec.links.${index}.renderVariables`,
|
|
193
199
|
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
194
200
|
label: "Render Variables",
|
|
195
201
|
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Checkbox, {
|
|
@@ -200,7 +206,8 @@ function LinkControl({ index }) {
|
|
|
200
206
|
})
|
|
201
207
|
}),
|
|
202
208
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
203
|
-
|
|
209
|
+
control: control,
|
|
210
|
+
name: `panelDefinition.spec.links.${index}.targetBlank`,
|
|
204
211
|
render: ({ field })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControlLabel, {
|
|
205
212
|
label: "Open in new tab",
|
|
206
213
|
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Checkbox, {
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
LoadingOverlay: function() {
|
|
25
|
+
return LoadingOverlay;
|
|
26
|
+
},
|
|
27
|
+
NoDataOverlay: function() {
|
|
28
|
+
return NoDataOverlay;
|
|
29
|
+
},
|
|
30
|
+
TextOverlay: function() {
|
|
31
|
+
return TextOverlay;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
35
|
+
const _material = require("@mui/material");
|
|
36
|
+
function TextOverlay(props) {
|
|
37
|
+
const { message } = props;
|
|
38
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
39
|
+
sx: {
|
|
40
|
+
height: '100%',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
justifyContent: 'center'
|
|
43
|
+
},
|
|
44
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
45
|
+
children: message
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function NoDataOverlay(props) {
|
|
50
|
+
const { resource } = props;
|
|
51
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(TextOverlay, {
|
|
52
|
+
message: `No ${resource}`
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function LoadingOverlay(props) {
|
|
56
|
+
const { variant = 'rounded' } = props;
|
|
57
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
58
|
+
sx: {
|
|
59
|
+
height: '100%',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
padding: '0 10px'
|
|
63
|
+
},
|
|
64
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Skeleton, {
|
|
65
|
+
variant: variant,
|
|
66
|
+
width: "100%",
|
|
67
|
+
height: "30%",
|
|
68
|
+
"aria-label": "Loading..."
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_export_star(require("./Overlay"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return from;
|
|
30
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License | Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing | software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS |
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND | either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "SortSelectorButtons", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return SortSelectorButtons;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
function SortSelectorButtons({ onChange, value, ...props }) {
|
|
26
|
+
const handleSortChange = (sort)=>{
|
|
27
|
+
onChange(sort);
|
|
28
|
+
};
|
|
29
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.ButtonGroup, {
|
|
30
|
+
"aria-label": "Sort",
|
|
31
|
+
sx: {
|
|
32
|
+
margin: 1
|
|
33
|
+
},
|
|
34
|
+
...props,
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
37
|
+
onClick: ()=>handleSortChange(undefined),
|
|
38
|
+
variant: value === undefined ? 'contained' : 'outlined',
|
|
39
|
+
children: "None"
|
|
40
|
+
}),
|
|
41
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
42
|
+
onClick: ()=>handleSortChange('asc'),
|
|
43
|
+
variant: value === 'asc' ? 'contained' : 'outlined',
|
|
44
|
+
children: "Ascending"
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
47
|
+
onClick: ()=>handleSortChange('desc'),
|
|
48
|
+
variant: value === 'desc' ? 'contained' : 'outlined',
|
|
49
|
+
children: "Descending"
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
_export_star(require("./SortSelector"), exports);
|
|
18
|
+
_export_star(require("./SortSelectorButtons"), exports);
|
|
18
19
|
function _export_star(from, to) {
|
|
19
20
|
Object.keys(from).forEach(function(k) {
|
|
20
21
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
@@ -31,7 +31,8 @@ const StyledMuiTable = (0, _material.styled)(_material.Table)(({ theme })=>({
|
|
|
31
31
|
}));
|
|
32
32
|
const TABLE_DENSITY_CONFIG = {
|
|
33
33
|
compact: 'small',
|
|
34
|
-
standard: 'medium'
|
|
34
|
+
standard: 'medium',
|
|
35
|
+
comfortable: 'medium'
|
|
35
36
|
};
|
|
36
37
|
const InnerTable = /*#__PURE__*/ (0, _react.forwardRef)(function InnerTable({ density, ...otherProps }, ref) {
|
|
37
38
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(StyledMuiTable, {
|
|
@@ -39,7 +39,7 @@ const StyledMuiTableCell = (0, _material.styled)(_material.TableCell)(({ theme }
|
|
|
39
39
|
borderRadius: 0
|
|
40
40
|
}
|
|
41
41
|
}));
|
|
42
|
-
function TableCell({ children, density, variant, width, focusState = 'none', onFocusTrigger, isFirstColumn, isLastColumn, description, ...otherProps }) {
|
|
42
|
+
function TableCell({ children, density, variant, width, focusState = 'none', onFocusTrigger, isFirstColumn, isLastColumn, description, align, ...otherProps }) {
|
|
43
43
|
const theme = (0, _material.useTheme)();
|
|
44
44
|
const elRef = (0, _react.useRef)();
|
|
45
45
|
const isHeader = variant === 'head';
|
|
@@ -101,6 +101,8 @@ function TableCell({ children, density, variant, width, focusState = 'none', onF
|
|
|
101
101
|
flexDirection: 'inherit'
|
|
102
102
|
},
|
|
103
103
|
title: description,
|
|
104
|
+
"aria-label": description,
|
|
105
|
+
textAlign: align,
|
|
104
106
|
children: children
|
|
105
107
|
})
|
|
106
108
|
});
|
|
@@ -36,31 +36,36 @@ function calculateTableCellHeight(lineHeight, paddingY) {
|
|
|
36
36
|
return lineHeightNum + verticalPaddingNum * 2;
|
|
37
37
|
}
|
|
38
38
|
function getTableCellLayout(theme, density, { isLastColumn, isFirstColumn } = {}) {
|
|
39
|
+
// Density Standard
|
|
40
|
+
let paddingY = theme.spacing(1);
|
|
41
|
+
let basePaddingX = theme.spacing(1.25);
|
|
42
|
+
let edgePaddingX = theme.spacing(2);
|
|
43
|
+
let paddingLeft = isFirstColumn ? edgePaddingX : basePaddingX;
|
|
44
|
+
let paddingRight = isLastColumn ? edgePaddingX : basePaddingX;
|
|
45
|
+
let lineHeight = theme.typography.body1.lineHeight;
|
|
46
|
+
let fontSize = theme.typography.body1.fontSize;
|
|
39
47
|
if (density === 'compact') {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
paddingY = theme.spacing(0.5);
|
|
49
|
+
basePaddingX = theme.spacing(0.5);
|
|
50
|
+
edgePaddingX = theme.spacing(1);
|
|
51
|
+
paddingLeft = isFirstColumn ? edgePaddingX : basePaddingX;
|
|
52
|
+
paddingRight = isLastColumn ? edgePaddingX : basePaddingX;
|
|
53
|
+
lineHeight = theme.typography.body2.lineHeight;
|
|
54
|
+
fontSize = theme.typography.body2.fontSize;
|
|
55
|
+
}
|
|
56
|
+
if (density === 'comfortable') {
|
|
57
|
+
paddingY = theme.spacing(2);
|
|
58
|
+
basePaddingX = theme.spacing(1.5);
|
|
59
|
+
edgePaddingX = theme.spacing(2);
|
|
60
|
+
paddingLeft = isFirstColumn ? edgePaddingX : basePaddingX;
|
|
61
|
+
paddingRight = isLastColumn ? edgePaddingX : basePaddingX;
|
|
62
|
+
lineHeight = theme.typography.body1.lineHeight;
|
|
63
|
+
fontSize = theme.typography.body1.fontSize;
|
|
52
64
|
}
|
|
53
|
-
// standard density
|
|
54
|
-
const paddingY = theme.spacing(1);
|
|
55
|
-
const basePaddingX = theme.spacing(1.25);
|
|
56
|
-
const edgePaddingX = theme.spacing(2);
|
|
57
|
-
const paddingLeft = isFirstColumn ? edgePaddingX : basePaddingX;
|
|
58
|
-
const paddingRight = isLastColumn ? edgePaddingX : basePaddingX;
|
|
59
|
-
const lineHeight = theme.typography.body1.lineHeight;
|
|
60
65
|
return {
|
|
61
66
|
padding: `${paddingY} ${paddingRight} ${paddingY} ${paddingLeft}`,
|
|
62
67
|
height: calculateTableCellHeight(lineHeight, paddingY),
|
|
63
|
-
fontSize:
|
|
68
|
+
fontSize: fontSize,
|
|
64
69
|
lineHeight: lineHeight
|
|
65
70
|
};
|
|
66
71
|
}
|
|
@@ -24,7 +24,7 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _react = require("react");
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
|
|
27
|
-
const
|
|
27
|
+
const _OptionsColorPicker = require("../ColorPicker/OptionsColorPicker");
|
|
28
28
|
function _interop_require_default(obj) {
|
|
29
29
|
return obj && obj.__esModule ? obj : {
|
|
30
30
|
default: obj
|
|
@@ -39,7 +39,7 @@ function ThresholdInput({ inputRef, label, color, value, mode, onChange, onColor
|
|
|
39
39
|
justifyContent: "space-between",
|
|
40
40
|
spacing: 1,
|
|
41
41
|
children: [
|
|
42
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
42
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsColorPicker.OptionsColorPicker, {
|
|
43
43
|
label: label,
|
|
44
44
|
color: color,
|
|
45
45
|
onColorChange: onColorChange
|
|
@@ -29,7 +29,7 @@ const _system = require("@mui/system");
|
|
|
29
29
|
const _ChartsProvider = require("../context/ChartsProvider");
|
|
30
30
|
const _OptionsEditorLayout = require("../OptionsEditorLayout");
|
|
31
31
|
const _InfoTooltip = require("../InfoTooltip");
|
|
32
|
-
const
|
|
32
|
+
const _OptionsColorPicker = require("../ColorPicker/OptionsColorPicker");
|
|
33
33
|
const _ThresholdInput = require("./ThresholdInput");
|
|
34
34
|
function _interop_require_default(obj) {
|
|
35
35
|
return obj && obj.__esModule ? obj : {
|
|
@@ -274,7 +274,7 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
|
|
|
274
274
|
alignItems: "center",
|
|
275
275
|
spacing: 1,
|
|
276
276
|
children: [
|
|
277
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
277
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsColorPicker.OptionsColorPicker, {
|
|
278
278
|
label: "default",
|
|
279
279
|
color: defaultThresholdColor,
|
|
280
280
|
onColorChange: handleDefaultColorChange
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "DateTimeRangePicker", {
|
|
18
18
|
enumerable: true,
|
|
19
19
|
get: function() {
|
|
20
|
-
return
|
|
20
|
+
return DateTimeRangePicker;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -25,23 +25,24 @@ const _react = require("react");
|
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _xdatepickers = require("@mui/x-date-pickers");
|
|
27
27
|
const _AdapterDateFns = require("@mui/x-date-pickers/AdapterDateFns");
|
|
28
|
-
const
|
|
28
|
+
const _context = require("../context");
|
|
29
|
+
const _ErrorBoundary = require("../ErrorBoundary");
|
|
30
|
+
const _ErrorAlert = require("../ErrorAlert");
|
|
29
31
|
const _utils = require("./utils");
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const { formatWithUserTimeZone } = (0, _TimeZoneProvider.useTimeZone)();
|
|
32
|
+
const DateTimeRangePicker = ({ initialTimeRange, onChange, onCancel })=>{
|
|
33
|
+
const { formatWithUserTimeZone } = (0, _context.useTimeZone)();
|
|
33
34
|
// Time range values as dates that can be used as a time range.
|
|
34
35
|
const [timeRange, setTimeRange] = (0, _react.useState)(initialTimeRange);
|
|
35
36
|
// Time range values as strings used to populate the text inputs. May not
|
|
36
37
|
// be valid as dates when the user is typing.
|
|
37
38
|
const [timeRangeInputs, setTimeRangeInputs] = (0, _react.useState)({
|
|
38
|
-
start: formatWithUserTimeZone(initialTimeRange.start, DATE_TIME_FORMAT),
|
|
39
|
-
end: formatWithUserTimeZone(initialTimeRange.end, DATE_TIME_FORMAT)
|
|
39
|
+
start: formatWithUserTimeZone(initialTimeRange.start, _utils.DATE_TIME_FORMAT),
|
|
40
|
+
end: formatWithUserTimeZone(initialTimeRange.end, _utils.DATE_TIME_FORMAT)
|
|
40
41
|
});
|
|
41
42
|
const [showStartCalendar, setShowStartCalendar] = (0, _react.useState)(true);
|
|
42
43
|
const changeTimeRange = (newTime, segment)=>{
|
|
43
44
|
const isInputChange = typeof newTime === 'string';
|
|
44
|
-
const newInputTime = isInputChange ? newTime : formatWithUserTimeZone(newTime, DATE_TIME_FORMAT);
|
|
45
|
+
const newInputTime = isInputChange ? newTime : formatWithUserTimeZone(newTime, _utils.DATE_TIME_FORMAT);
|
|
45
46
|
setTimeRangeInputs((prevTimeRangeInputs)=>{
|
|
46
47
|
return {
|
|
47
48
|
...prevTimeRangeInputs,
|
|
@@ -159,27 +160,35 @@ const AbsoluteTimePicker = ({ initialTimeRange, onChange, onCancel })=>{
|
|
|
159
160
|
pl: 1,
|
|
160
161
|
pr: 1,
|
|
161
162
|
children: [
|
|
162
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
163
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ErrorBoundary.ErrorBoundary, {
|
|
164
|
+
FallbackComponent: _ErrorAlert.ErrorAlert,
|
|
165
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_xdatepickers.DateTimeField, {
|
|
166
|
+
label: "Start Time",
|
|
167
|
+
// @ts-expect-error: because the value is a Date, but the component expects a string
|
|
168
|
+
value: new Date(timeRangeInputs.start),
|
|
169
|
+
onChange: (event)=>{
|
|
170
|
+
if (event) {
|
|
171
|
+
onChangeStartTime(event);
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
onBlur: ()=>updateDateRange(),
|
|
175
|
+
format: _utils.DATE_TIME_FORMAT
|
|
176
|
+
})
|
|
173
177
|
}),
|
|
174
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ErrorBoundary.ErrorBoundary, {
|
|
179
|
+
FallbackComponent: _ErrorAlert.ErrorAlert,
|
|
180
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_xdatepickers.DateTimeField, {
|
|
181
|
+
label: "End Time",
|
|
182
|
+
// @ts-expect-error: because the value is a Date, but the component expects a string
|
|
183
|
+
value: new Date(timeRangeInputs.end),
|
|
184
|
+
onChange: (event)=>{
|
|
185
|
+
if (event) {
|
|
186
|
+
onChangeEndTime(event);
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
onBlur: ()=>updateDateRange(),
|
|
190
|
+
format: _utils.DATE_TIME_FORMAT
|
|
191
|
+
})
|
|
183
192
|
})
|
|
184
193
|
]
|
|
185
194
|
}),
|