@perses-dev/dashboards 0.21.0 → 0.22.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/cjs/components/AddGroupButton/AddGroupButton.js +43 -0
- package/dist/cjs/components/AddGroupButton/index.js +28 -0
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +43 -0
- package/dist/cjs/components/AddPanelButton/index.js +28 -0
- package/dist/cjs/components/Dashboard/Dashboard.js +1 -1
- package/dist/cjs/components/Dashboard/index.js +1 -1
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +47 -22
- package/dist/cjs/components/DashboardToolbar/index.js +1 -1
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +1 -1
- package/dist/cjs/components/DeletePanelDialog/index.js +1 -1
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +1 -1
- package/dist/cjs/components/DeletePanelGroupDialog/index.js +1 -1
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +1 -1
- package/dist/cjs/components/DownloadButton/DownloadButton.js +17 -53
- package/dist/cjs/components/DownloadButton/index.js +1 -1
- package/dist/cjs/components/GridLayout/GridContainer.js +2 -1
- package/dist/cjs/components/GridLayout/GridItemContent.js +1 -1
- package/dist/cjs/components/GridLayout/GridLayout.js +2 -1
- package/dist/cjs/components/GridLayout/GridTitle.js +14 -11
- package/dist/cjs/components/GridLayout/index.js +1 -1
- package/dist/cjs/components/Panel/Panel.js +2 -1
- package/dist/cjs/components/Panel/Panel.test.js +1 -1
- package/dist/cjs/components/Panel/PanelContent.js +1 -1
- package/dist/cjs/components/Panel/PanelHeader.js +9 -8
- package/dist/cjs/components/Panel/index.js +1 -1
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +2 -1
- package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +1 -1
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +1 -1
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +1 -1
- package/dist/cjs/components/PanelDrawer/index.js +1 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +3 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +1 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/cjs/components/PanelGroupDialog/index.js +1 -1
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +14 -16
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +1 -1
- package/dist/cjs/components/TimeRangeControls/index.js +1 -1
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +35 -0
- package/dist/cjs/components/ToolbarIconButton/index.js +28 -0
- package/dist/cjs/components/Variables/EditVariablesButton.js +74 -0
- package/dist/cjs/components/Variables/Variable.js +1 -1
- package/dist/cjs/components/Variables/VariableEditor.js +9 -5
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +6 -7
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +1 -1
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
- package/dist/cjs/components/Variables/VariableList.js +38 -110
- package/dist/cjs/components/Variables/index.js +4 -2
- package/dist/cjs/components/Variables/variable-model.js +1 -1
- package/dist/cjs/components/Variables/variable-model.test.js +1 -1
- package/dist/cjs/components/index.js +5 -2
- package/dist/cjs/constants/index.js +28 -0
- package/dist/cjs/constants/user-interface-text.js +59 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +1 -1
- package/dist/cjs/context/DashboardProvider/common.js +1 -1
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +1 -1
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/index.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-slice.js +1 -1
- package/dist/cjs/context/DatasourceStoreProvider.js +1 -1
- package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +8 -8
- package/dist/cjs/context/TemplateVariableProvider/index.js +1 -1
- package/dist/cjs/context/TemplateVariableProvider/query-params.js +1 -1
- package/dist/cjs/context/TemplateVariableProvider/query-params.test.js +1 -1
- package/dist/cjs/context/index.js +1 -1
- package/dist/cjs/context/useDashboard.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/test/dashboard-provider.js +1 -1
- package/dist/cjs/test/index.js +1 -1
- package/dist/cjs/test/plugin-registry.js +1 -1
- package/dist/cjs/test/render.js +1 -1
- package/dist/cjs/test/setup-tests.js +1 -1
- package/dist/cjs/test/testDashboard.js +1 -1
- package/dist/cjs/utils/functions.js +1 -1
- package/dist/cjs/utils/index.js +28 -0
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +1 -1
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +1 -1
- package/dist/cjs/views/ViewDashboard/index.js +1 -1
- package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +1 -1
- package/dist/cjs/views/index.js +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +3 -0
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -0
- package/dist/components/AddGroupButton/AddGroupButton.js +32 -0
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -0
- package/dist/components/AddGroupButton/index.d.ts +2 -0
- package/dist/components/AddGroupButton/index.d.ts.map +1 -0
- package/dist/components/AddGroupButton/index.js +15 -0
- package/dist/components/AddGroupButton/index.js.map +1 -0
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +3 -0
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -0
- package/dist/components/AddPanelButton/AddPanelButton.js +32 -0
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -0
- package/dist/components/AddPanelButton/index.d.ts +2 -0
- package/dist/components/AddPanelButton/index.d.ts.map +1 -0
- package/dist/components/AddPanelButton/index.js +15 -0
- package/dist/components/AddPanelButton/index.js.map +1 -0
- package/dist/components/Dashboard/Dashboard.js +1 -1
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Dashboard/index.js +1 -1
- package/dist/components/Dashboard/index.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +48 -23
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/index.js +1 -1
- package/dist/components/DashboardToolbar/index.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelDialog/index.js +1 -1
- package/dist/components/DeletePanelDialog/index.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/index.js +1 -1
- package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/index.js +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +5 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +18 -15
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/DownloadButton/index.js +1 -1
- package/dist/components/DownloadButton/index.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +2 -1
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +1 -1
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +2 -1
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +14 -11
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/GridLayout/index.js +1 -1
- package/dist/components/GridLayout/index.js.map +1 -1
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +2 -1
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/Panel.test.js +1 -1
- package/dist/components/Panel/Panel.test.js.map +1 -1
- package/dist/components/Panel/PanelContent.js +1 -1
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +9 -8
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/index.js +1 -1
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +2 -1
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.test.js +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.test.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/index.js +1 -1
- package/dist/components/PanelDrawer/index.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +3 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
- package/dist/components/PanelGroupDialog/index.js +1 -1
- package/dist/components/PanelGroupDialog/index.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +15 -17
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +1 -1
- package/dist/components/TimeRangeControls/index.js +1 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +6 -0
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -0
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js +29 -0
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +1 -0
- package/dist/components/ToolbarIconButton/index.d.ts +2 -0
- package/dist/components/ToolbarIconButton/index.d.ts.map +1 -0
- package/dist/components/ToolbarIconButton/index.js +15 -0
- package/dist/components/ToolbarIconButton/index.js.map +1 -0
- package/dist/components/Variables/EditVariablesButton.d.ts +3 -0
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -0
- package/dist/components/Variables/EditVariablesButton.js +63 -0
- package/dist/components/Variables/EditVariablesButton.js.map +1 -0
- package/dist/components/Variables/Variable.js +1 -1
- package/dist/components/Variables/Variable.js.map +1 -1
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +9 -5
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +8 -9
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +40 -73
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +3 -1
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +4 -2
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/Variables/variable-model.js +1 -1
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/Variables/variable-model.test.js +1 -1
- package/dist/components/Variables/variable-model.test.js.map +1 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +15 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/user-interface-text.d.ts +28 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -0
- package/dist/constants/user-interface-text.js +47 -0
- package/dist/constants/user-interface-text.js.map +1 -0
- package/dist/context/DashboardProvider/DashboardProvider.js +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/common.js +1 -1
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/discard-changes-dialog-slice.js +1 -1
- package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/index.js +1 -1
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-slice.js +1 -1
- package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +1 -1
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +8 -8
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/index.js +1 -1
- package/dist/context/TemplateVariableProvider/index.js.map +1 -1
- package/dist/context/TemplateVariableProvider/query-params.js +1 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
- package/dist/context/TemplateVariableProvider/query-params.test.js +1 -1
- package/dist/context/TemplateVariableProvider/query-params.test.js.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/useDashboard.js +1 -1
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/test/dashboard-provider.js +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/index.js +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/plugin-registry.js +1 -1
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.js +1 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/testDashboard.js +1 -1
- package/dist/test/testDashboard.js.map +1 -1
- package/dist/utils/functions.js +1 -1
- package/dist/utils/functions.js.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +15 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.js +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/dist/views/ViewDashboard/index.js +1 -1
- package/dist/views/ViewDashboard/index.js.map +1 -1
- package/dist/views/ViewDashboard/tests/panelGroups.test.js +1 -1
- package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +1 -1
- package/dist/views/index.js +1 -1
- package/dist/views/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 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
|
|
@@ -19,132 +19,60 @@ Object.defineProperty(exports, "TemplateVariableList", {
|
|
|
19
19
|
get: ()=>TemplateVariableList
|
|
20
20
|
});
|
|
21
21
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const _react =
|
|
22
|
+
const _react = require("react");
|
|
23
23
|
const _material = require("@mui/material");
|
|
24
|
-
const _pencil = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Pencil"));
|
|
25
24
|
const _pinOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PinOutline"));
|
|
26
25
|
const _pinOffOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PinOffOutline"));
|
|
27
|
-
const _components = require("@perses-dev/components");
|
|
28
26
|
const _context = require("../../context");
|
|
29
27
|
const _variable = require("./Variable");
|
|
30
|
-
const _variableEditor = require("./VariableEditor");
|
|
31
28
|
function _interopRequireDefault(obj) {
|
|
32
29
|
return obj && obj.__esModule ? obj : {
|
|
33
30
|
default: obj
|
|
34
31
|
};
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var cacheBabelInterop = new WeakMap();
|
|
39
|
-
var cacheNodeInterop = new WeakMap();
|
|
40
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
41
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
42
|
-
})(nodeInterop);
|
|
43
|
-
}
|
|
44
|
-
function _interopRequireWildcard(obj, nodeInterop) {
|
|
45
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
46
|
-
return obj;
|
|
47
|
-
}
|
|
48
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
49
|
-
return {
|
|
50
|
-
default: obj
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
54
|
-
if (cache && cache.has(obj)) {
|
|
55
|
-
return cache.get(obj);
|
|
56
|
-
}
|
|
57
|
-
var newObj = {};
|
|
58
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
59
|
-
for(var key in obj){
|
|
60
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
61
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
62
|
-
if (desc && (desc.get || desc.set)) {
|
|
63
|
-
Object.defineProperty(newObj, key, desc);
|
|
64
|
-
} else {
|
|
65
|
-
newObj[key] = obj[key];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
newObj.default = obj;
|
|
70
|
-
if (cache) {
|
|
71
|
-
cache.set(obj, newObj);
|
|
72
|
-
}
|
|
73
|
-
return newObj;
|
|
74
|
-
}
|
|
33
|
+
const VARIABLE_INPUT_MIN_WIDTH = '120px';
|
|
34
|
+
const VARIABLE_INPUT_MAX_WIDTH = '240px';
|
|
75
35
|
function TemplateVariableList(props) {
|
|
76
|
-
const [isEditing, setIsEditing] = (0, _react.useState)(false);
|
|
77
36
|
const [isPin, setIsPin] = (0, _react.useState)(props.initialVariableIsSticky);
|
|
78
37
|
const variableDefinitions = (0, _context.useTemplateVariableDefinitions)();
|
|
79
|
-
const { isEditMode } = (0, _context.useEditMode)();
|
|
80
|
-
const { setVariableDefinitions } = (0, _context.useTemplateVariableActions)();
|
|
81
38
|
const scrollTrigger = (0, _material.useScrollTrigger)({
|
|
82
39
|
disableHysteresis: true
|
|
83
40
|
});
|
|
84
41
|
const isSticky = scrollTrigger && props.initialVariableIsSticky && isPin;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
elevation: isSticky ? 4 : 0,
|
|
119
|
-
sx: {
|
|
120
|
-
...props.sx
|
|
121
|
-
},
|
|
122
|
-
children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
123
|
-
display: 'flex',
|
|
124
|
-
justifyContent: "space-between",
|
|
125
|
-
my: isSticky ? 2 : 0,
|
|
126
|
-
ml: isSticky ? 2 : 0,
|
|
127
|
-
children: [
|
|
128
|
-
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Stack, {
|
|
129
|
-
direction: "row",
|
|
130
|
-
spacing: 1,
|
|
131
|
-
children: variableDefinitions.map((v)=>{
|
|
132
|
-
var ref;
|
|
133
|
-
/*#__PURE__*/ return (0, _jsxRuntime.jsx)(_material.Box, {
|
|
134
|
-
display: ((ref = v.spec.display) === null || ref === void 0 ? void 0 : ref.hidden) ? 'none' : undefined,
|
|
135
|
-
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_variable.TemplateVariable, {
|
|
136
|
-
name: v.spec.name
|
|
137
|
-
}, v.spec.name)
|
|
138
|
-
}, v.spec.name);
|
|
139
|
-
})
|
|
140
|
-
}),
|
|
141
|
-
props.initialVariableIsSticky && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
142
|
-
onClick: ()=>setIsPin(!isPin),
|
|
143
|
-
children: isPin ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pinOutline.default, {}) : /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pinOffOutline.default, {})
|
|
144
|
-
})
|
|
145
|
-
]
|
|
146
|
-
})
|
|
42
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
|
|
43
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.AppBar, {
|
|
44
|
+
color: "inherit",
|
|
45
|
+
position: isSticky ? 'fixed' : 'static',
|
|
46
|
+
elevation: isSticky ? 4 : 0,
|
|
47
|
+
sx: {
|
|
48
|
+
...props.sx
|
|
49
|
+
},
|
|
50
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
|
|
51
|
+
display: "flex",
|
|
52
|
+
flexWrap: "wrap",
|
|
53
|
+
alignItems: "start",
|
|
54
|
+
my: isSticky ? 2 : 0,
|
|
55
|
+
ml: isSticky ? 2 : 0,
|
|
56
|
+
children: [
|
|
57
|
+
variableDefinitions.map((v)=>{
|
|
58
|
+
var ref;
|
|
59
|
+
/*#__PURE__*/ return (0, _jsxRuntime.jsx)(_material.Box, {
|
|
60
|
+
display: ((ref = v.spec.display) === null || ref === void 0 ? void 0 : ref.hidden) ? 'none' : undefined,
|
|
61
|
+
minWidth: VARIABLE_INPUT_MIN_WIDTH,
|
|
62
|
+
maxWidth: VARIABLE_INPUT_MAX_WIDTH,
|
|
63
|
+
marginBottom: 1,
|
|
64
|
+
marginRight: 1,
|
|
65
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_variable.TemplateVariable, {
|
|
66
|
+
name: v.spec.name
|
|
67
|
+
}, v.spec.name)
|
|
68
|
+
}, v.spec.name);
|
|
69
|
+
}),
|
|
70
|
+
props.initialVariableIsSticky && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
71
|
+
onClick: ()=>setIsPin(!isPin),
|
|
72
|
+
children: isPin ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pinOutline.default, {}) : /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pinOffOutline.default, {})
|
|
73
|
+
})
|
|
74
|
+
]
|
|
147
75
|
})
|
|
148
|
-
|
|
76
|
+
})
|
|
149
77
|
});
|
|
150
78
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 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,9 +14,11 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
+
_exportStar(require("./EditVariablesButton"), exports);
|
|
17
18
|
_exportStar(require("./Variable"), exports);
|
|
18
|
-
_exportStar(require("./
|
|
19
|
+
_exportStar(require("./VariableEditor"), exports);
|
|
19
20
|
_exportStar(require("./VariableEditorForm"), exports);
|
|
21
|
+
_exportStar(require("./VariableList"), exports);
|
|
20
22
|
function _exportStar(from, to) {
|
|
21
23
|
Object.keys(from).forEach(function(k) {
|
|
22
24
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 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,17 +14,20 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", {
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
|
+
_exportStar(require("./AddGroupButton"), exports);
|
|
18
|
+
_exportStar(require("./AddPanelButton"), exports);
|
|
17
19
|
_exportStar(require("./Dashboard"), exports);
|
|
18
20
|
_exportStar(require("./DashboardToolbar"), exports);
|
|
19
21
|
_exportStar(require("./DeletePanelDialog"), exports);
|
|
20
22
|
_exportStar(require("./DeletePanelGroupDialog"), exports);
|
|
23
|
+
_exportStar(require("./DiscardChangesConfirmationDialog"), exports);
|
|
21
24
|
_exportStar(require("./DownloadButton"), exports);
|
|
22
25
|
_exportStar(require("./GridLayout"), exports);
|
|
23
26
|
_exportStar(require("./Panel"), exports);
|
|
24
27
|
_exportStar(require("./PanelDrawer"), exports);
|
|
25
28
|
_exportStar(require("./PanelGroupDialog"), exports);
|
|
26
29
|
_exportStar(require("./TimeRangeControls"), exports);
|
|
27
|
-
_exportStar(require("./
|
|
30
|
+
_exportStar(require("./ToolbarIconButton"), exports);
|
|
28
31
|
_exportStar(require("./Variables"), exports);
|
|
29
32
|
function _exportStar(from, to) {
|
|
30
33
|
Object.keys(from).forEach(function(k) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2023 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
|
+
_exportStar(require("./user-interface-text"), exports);
|
|
18
|
+
function _exportStar(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return from[k];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return from;
|
|
28
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright 2023 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
|
+
TOOLTIP_TEXT: ()=>TOOLTIP_TEXT,
|
|
25
|
+
ARIA_LABEL_TEXT: ()=>ARIA_LABEL_TEXT
|
|
26
|
+
});
|
|
27
|
+
const TOOLTIP_TEXT = {
|
|
28
|
+
// Toolbar buttons
|
|
29
|
+
addPanel: 'Add panel',
|
|
30
|
+
addGroup: 'Add panel group',
|
|
31
|
+
downloadDashboard: 'Download JSON',
|
|
32
|
+
editVariables: 'Edit variables',
|
|
33
|
+
refreshDashboard: 'Refresh dashboard',
|
|
34
|
+
// Group buttons
|
|
35
|
+
addPanelToGroup: 'Add panel to group',
|
|
36
|
+
deleteGroup: 'Delete group',
|
|
37
|
+
editGroup: 'Edit group',
|
|
38
|
+
moveGroupDown: 'Move group down',
|
|
39
|
+
moveGroupUp: 'Move group up',
|
|
40
|
+
// Panel buttons
|
|
41
|
+
editPanel: 'Edit',
|
|
42
|
+
deletePanel: 'Delete',
|
|
43
|
+
movePanel: 'Move',
|
|
44
|
+
// Variable editor buttons
|
|
45
|
+
refreshVariableValues: 'Refresh values',
|
|
46
|
+
copyVariableValues: 'Copy values to clipboard'
|
|
47
|
+
};
|
|
48
|
+
const ARIA_LABEL_TEXT = {
|
|
49
|
+
// Group buttons
|
|
50
|
+
addPanelToGroup: (groupName)=>`add panel to group ${groupName}`,
|
|
51
|
+
deleteGroup: (groupName)=>`delete group ${groupName}`,
|
|
52
|
+
editGroup: (groupName)=>`edit group ${groupName}`,
|
|
53
|
+
moveGroupDown: (groupName)=>`move group ${groupName} down`,
|
|
54
|
+
moveGroupUp: (groupName)=>`move group ${groupName} up`,
|
|
55
|
+
// Panel buttons
|
|
56
|
+
editPanel: (panelName)=>`edit panel ${panelName}`,
|
|
57
|
+
deletePanel: (panelName)=>`delete panel ${panelName}`,
|
|
58
|
+
movePanel: (panelName)=>`move panel ${panelName}`
|
|
59
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 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
|
|
@@ -187,25 +187,25 @@ function TemplateVariableProvider({ children , initialVariableDefinitions =[] }
|
|
|
187
187
|
})
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
|
-
/** Helpers */ function hydrateTemplateVariableState(
|
|
191
|
-
const v = definition;
|
|
192
|
-
var ref;
|
|
190
|
+
/** Helpers */ function hydrateTemplateVariableState(variable, initialValue) {
|
|
193
191
|
const varState = {
|
|
194
|
-
value:
|
|
192
|
+
value: null,
|
|
195
193
|
loading: false
|
|
196
194
|
};
|
|
197
|
-
switch(
|
|
195
|
+
switch(variable.kind){
|
|
198
196
|
case 'TextVariable':
|
|
199
|
-
varState.value = initialValue !== null && initialValue !== void 0 ? initialValue :
|
|
197
|
+
varState.value = initialValue !== null && initialValue !== void 0 ? initialValue : variable.spec.value;
|
|
200
198
|
break;
|
|
201
199
|
case 'ListVariable':
|
|
202
200
|
varState.options = [];
|
|
201
|
+
var ref;
|
|
202
|
+
varState.value = (ref = initialValue !== null && initialValue !== void 0 ? initialValue : variable.spec.default_value) !== null && ref !== void 0 ? ref : null;
|
|
203
203
|
if (varState.options.length > 0 && !varState.value) {
|
|
204
204
|
var ref1;
|
|
205
205
|
var ref2;
|
|
206
206
|
const firstOptionValue = (ref2 = (ref1 = varState.options[0]) === null || ref1 === void 0 ? void 0 : ref1.value) !== null && ref2 !== void 0 ? ref2 : null;
|
|
207
207
|
if (firstOptionValue !== null) {
|
|
208
|
-
varState.value =
|
|
208
|
+
varState.value = variable.spec.allow_multiple ? [
|
|
209
209
|
firstOptionValue
|
|
210
210
|
] : firstOptionValue;
|
|
211
211
|
}
|
package/dist/cjs/index.js
CHANGED
package/dist/cjs/test/index.js
CHANGED
package/dist/cjs/test/render.js
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2023 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
|
+
_exportStar(require("./functions"), exports);
|
|
18
|
+
function _exportStar(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return from[k];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return from;
|
|
28
|
+
}
|
package/dist/cjs/views/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddGroupButton.d.ts","sourceRoot":"","sources":["../../../src/components/AddGroupButton/AddGroupButton.tsx"],"names":[],"mappings":";AAmBA,eAAO,MAAM,cAAc,mBAU1B,CAAC"}
|