@perses-dev/dashboards 0.8.1 → 0.10.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/Dashboard.js +25 -14
- package/dist/cjs/components/DashboardToolbar.js +148 -20
- package/dist/cjs/components/GridLayout/GridItemContent.js +25 -19
- package/dist/cjs/components/GridLayout/GridLayout.js +92 -27
- package/dist/cjs/components/GridLayout/GridTitle.js +91 -31
- package/dist/cjs/components/GridLayout/index.js +18 -19
- package/dist/cjs/components/Panel/DeletePanelDialog.js +91 -0
- package/dist/cjs/components/Panel/Panel.js +156 -55
- package/dist/cjs/components/Panel/Panel.test.js +58 -41
- package/dist/cjs/components/Panel/PanelContent.js +41 -12
- package/dist/cjs/components/Panel/index.js +16 -17
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +84 -108
- package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +87 -92
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +194 -0
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +48 -0
- package/dist/cjs/components/PanelDrawer/index.js +28 -0
- package/dist/cjs/components/PanelGroupDialog/DeletePanelGroupDialog.js +86 -0
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +121 -39
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +74 -88
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +120 -38
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +42 -27
- package/dist/cjs/components/TimeRangeControls/index.js +16 -17
- package/dist/cjs/components/Variables/Variable.js +195 -36
- package/dist/cjs/components/Variables/VariableEditor.js +207 -0
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +236 -0
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +28 -0
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +88 -0
- package/dist/cjs/components/Variables/VariableList.js +81 -13
- package/dist/cjs/components/Variables/index.js +18 -18
- package/dist/cjs/components/index.js +21 -21
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +70 -0
- package/dist/cjs/context/DashboardProvider/common.js +18 -0
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +71 -0
- package/dist/cjs/context/DashboardProvider/index.js +29 -0
- package/dist/cjs/context/DashboardProvider/layout-slice.js +200 -0
- package/dist/cjs/context/DashboardProvider/panel-editing-slice.js +156 -0
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +38 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +170 -0
- package/dist/cjs/context/QueryStringProvider.js +69 -15
- package/dist/cjs/context/TemplateVariableProvider.js +135 -136
- package/dist/cjs/context/TimeRangeProvider.js +79 -30
- package/dist/cjs/context/index.js +20 -22
- package/dist/cjs/css/styles.js +43 -39
- package/dist/cjs/index.js +19 -20
- package/dist/cjs/test/dashboard-provider.js +51 -0
- package/dist/cjs/test/index.js +18 -18
- package/dist/cjs/test/plugin-registry.js +52 -25
- package/dist/cjs/test/render.js +25 -22
- package/dist/cjs/test/setup-tests.js +4 -2
- package/dist/cjs/test/testDashboard.js +203 -107
- package/dist/cjs/utils/functions.js +9 -5
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +49 -23
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +62 -31
- package/dist/cjs/views/ViewDashboard/index.js +16 -17
- package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +165 -0
- package/dist/cjs/views/index.js +16 -17
- package/dist/components/Dashboard.d.ts +1 -4
- package/dist/components/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard.js +34 -1
- package/dist/components/Dashboard.js.map +1 -0
- package/dist/components/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar.js +154 -1
- package/dist/components/DashboardToolbar.js.map +1 -0
- package/dist/components/GridLayout/GridItemContent.d.ts +3 -3
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +35 -1
- package/dist/components/GridLayout/GridItemContent.js.map +1 -0
- package/dist/components/GridLayout/GridLayout.d.ts +2 -3
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +102 -1
- package/dist/components/GridLayout/GridLayout.js.map +1 -0
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +99 -1
- package/dist/components/GridLayout/GridTitle.js.map +1 -0
- package/dist/components/GridLayout/index.js +16 -1
- package/dist/components/GridLayout/index.js.map +1 -0
- package/dist/components/Panel/DeletePanelDialog.d.ts +5 -0
- package/dist/components/Panel/DeletePanelDialog.d.ts.map +1 -0
- package/dist/components/Panel/DeletePanelDialog.js +80 -0
- package/dist/components/Panel/DeletePanelDialog.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +1 -1
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +181 -1
- package/dist/components/Panel/Panel.js.map +1 -0
- package/dist/components/Panel/Panel.test.js +74 -1
- package/dist/components/Panel/Panel.test.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +5 -4
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +41 -1
- package/dist/components/Panel/PanelContent.js.map +1 -0
- package/dist/components/Panel/index.js +15 -1
- package/dist/components/Panel/index.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +4 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +96 -1
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.test.js +99 -1
- package/dist/components/PanelDrawer/PanelDrawer.test.js.map +1 -0
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +12 -0
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelEditorForm.js +184 -0
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -0
- package/dist/components/PanelDrawer/PanelPreview.d.ts +4 -0
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -0
- package/dist/components/PanelDrawer/PanelPreview.js +42 -0
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -0
- package/dist/components/PanelDrawer/index.d.ts +2 -0
- package/dist/components/PanelDrawer/index.d.ts.map +1 -0
- package/dist/components/PanelDrawer/index.js +15 -0
- package/dist/components/PanelDrawer/index.js.map +1 -0
- package/dist/components/PanelGroupDialog/DeletePanelGroupDialog.d.ts +4 -0
- package/dist/components/PanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -0
- package/dist/components/PanelGroupDialog/DeletePanelGroupDialog.js +75 -0
- package/dist/components/PanelGroupDialog/DeletePanelGroupDialog.js.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +131 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -0
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +74 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.js +137 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js +59 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +1 -0
- package/dist/components/TimeRangeControls/index.js +15 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -0
- package/dist/components/Variables/Variable.d.ts.map +1 -1
- package/dist/components/Variables/Variable.js +210 -1
- package/dist/components/Variables/Variable.js.map +1 -0
- package/dist/components/Variables/VariableEditor.d.ts +8 -0
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditor.js +196 -0
- package/dist/components/Variables/VariableEditor.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +8 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +225 -0
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/index.d.ts +2 -0
- package/dist/components/Variables/VariableEditorForm/index.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/index.js +15 -0
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +21 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +76 -0
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -0
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +84 -1
- package/dist/components/Variables/VariableList.js.map +1 -0
- package/dist/components/Variables/index.d.ts +1 -0
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +17 -1
- package/dist/components/Variables/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +20 -1
- package/dist/components/index.js.map +1 -0
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +23 -0
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -0
- package/dist/context/DashboardProvider/DashboardProvider.js +52 -0
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -0
- package/dist/context/DashboardProvider/common.d.ts +5 -0
- package/dist/context/DashboardProvider/common.d.ts.map +1 -0
- package/dist/context/DashboardProvider/common.js +17 -0
- package/dist/context/DashboardProvider/common.js.map +1 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +32 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js +56 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -0
- package/dist/context/DashboardProvider/index.d.ts +3 -0
- package/dist/context/DashboardProvider/index.d.ts.map +1 -0
- package/dist/context/DashboardProvider/index.js +16 -0
- package/dist/context/DashboardProvider/index.js.map +1 -0
- package/dist/context/DashboardProvider/layout-slice.d.ts +57 -0
- package/dist/context/DashboardProvider/layout-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/layout-slice.js +196 -0
- package/dist/context/DashboardProvider/layout-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-editing-slice.d.ts +70 -0
- package/dist/context/DashboardProvider/panel-editing-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-editing-slice.js +152 -0
- package/dist/context/DashboardProvider/panel-editing-slice.js.map +1 -0
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +15 -0
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/panel-group-slice.js +32 -0
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -0
- package/dist/context/DatasourceStoreProvider.d.ts +24 -0
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -0
- package/dist/context/DatasourceStoreProvider.js +166 -0
- package/dist/context/DatasourceStoreProvider.js.map +1 -0
- package/dist/context/QueryStringProvider.js +40 -1
- package/dist/context/QueryStringProvider.js.map +1 -0
- package/dist/context/TemplateVariableProvider.d.ts +8 -3
- package/dist/context/TemplateVariableProvider.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider.js +199 -1
- package/dist/context/TemplateVariableProvider.js.map +1 -0
- package/dist/context/TimeRangeProvider.js +72 -1
- package/dist/context/TimeRangeProvider.js.map +1 -0
- package/dist/context/index.d.ts +3 -4
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +19 -1
- package/dist/context/index.js.map +1 -0
- package/dist/css/styles.js +186 -1
- package/dist/css/styles.js.map +1 -0
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -0
- package/dist/test/dashboard-provider.d.ts +19 -0
- package/dist/test/dashboard-provider.d.ts.map +1 -0
- package/dist/test/dashboard-provider.js +40 -0
- package/dist/test/dashboard-provider.js.map +1 -0
- package/dist/test/index.d.ts +1 -0
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +17 -1
- package/dist/test/index.js.map +1 -0
- package/dist/test/plugin-registry.d.ts +3 -4
- package/dist/test/plugin-registry.d.ts.map +1 -1
- package/dist/test/plugin-registry.js +74 -1
- package/dist/test/plugin-registry.js.map +1 -0
- package/dist/test/render.d.ts +1 -2
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +34 -1
- package/dist/test/render.js.map +1 -0
- package/dist/test/setup-tests.js +18 -1
- package/dist/test/setup-tests.js.map +1 -0
- package/dist/test/testDashboard.d.ts.map +1 -1
- package/dist/test/testDashboard.js +286 -1
- package/dist/test/testDashboard.js.map +1 -0
- package/dist/utils/functions.js +17 -1
- package/dist/utils/functions.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +55 -1
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -0
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -0
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +79 -1
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -0
- package/dist/views/ViewDashboard/index.js +15 -1
- package/dist/views/ViewDashboard/index.js.map +1 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts +2 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts.map +1 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.js +158 -0
- package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +1 -0
- package/dist/views/index.js +15 -1
- package/dist/views/index.js.map +1 -0
- package/package.json +13 -7
- package/dist/cjs/components/PanelDrawer/PanelOptionsEditor.js +0 -19
- package/dist/cjs/context/DashboardAppSlice.js +0 -45
- package/dist/cjs/context/DashboardProvider.js +0 -98
- package/dist/cjs/context/LayoutsSlice.js +0 -42
- package/dist/components/PanelDrawer/PanelOptionsEditor.d.ts +0 -9
- package/dist/components/PanelDrawer/PanelOptionsEditor.d.ts.map +0 -1
- package/dist/components/PanelDrawer/PanelOptionsEditor.js +0 -1
- package/dist/context/DashboardAppSlice.d.ts +0 -26
- package/dist/context/DashboardAppSlice.d.ts.map +0 -1
- package/dist/context/DashboardAppSlice.js +0 -1
- package/dist/context/DashboardProvider.d.ts +0 -34
- package/dist/context/DashboardProvider.d.ts.map +0 -1
- package/dist/context/DashboardProvider.js +0 -1
- package/dist/context/LayoutsSlice.d.ts +0 -12
- package/dist/context/LayoutsSlice.d.ts.map +0 -1
- package/dist/context/LayoutsSlice.js +0 -1
package/dist/context/index.js
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright 2022 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
|
+
export * from './DashboardProvider';
|
|
14
|
+
export * from './DatasourceStoreProvider';
|
|
15
|
+
export * from './QueryStringProvider';
|
|
16
|
+
export * from './TemplateVariableProvider';
|
|
17
|
+
export * from './TimeRangeProvider';
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/context/index.ts"],"sourcesContent":["// Copyright 2022 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\nexport * from './DashboardProvider';\nexport * from './DatasourceStoreProvider';\nexport * from './QueryStringProvider';\nexport * from './TemplateVariableProvider';\nexport * from './TimeRangeProvider';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC"}
|
package/dist/css/styles.js
CHANGED
|
@@ -1 +1,186 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright 2022 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
|
+
export const styles = (theme)=>{
|
|
14
|
+
return {
|
|
15
|
+
'&.react-grid-layout': {
|
|
16
|
+
position: 'relative',
|
|
17
|
+
transition: 'height 200ms ease'
|
|
18
|
+
},
|
|
19
|
+
'&.react-grid-item': {
|
|
20
|
+
transition: 'all 200ms ease',
|
|
21
|
+
transitionProperty: 'left, top'
|
|
22
|
+
},
|
|
23
|
+
'&.react-grid-item img': {
|
|
24
|
+
pointerEvents: 'none',
|
|
25
|
+
userSelect: 'none'
|
|
26
|
+
},
|
|
27
|
+
'&.react-grid-item.cssTransforms': {
|
|
28
|
+
transitionProperty: 'transform'
|
|
29
|
+
},
|
|
30
|
+
'&.react-grid-item.resizing': {
|
|
31
|
+
zIndex: 1,
|
|
32
|
+
willChange: 'width, height'
|
|
33
|
+
},
|
|
34
|
+
'&.react-grid-item.react-draggable-dragging': {
|
|
35
|
+
transition: 'none',
|
|
36
|
+
zIndex: 3,
|
|
37
|
+
willChange: 'transform'
|
|
38
|
+
},
|
|
39
|
+
'&.react-grid-item.dropping': {
|
|
40
|
+
visibility: 'hidden'
|
|
41
|
+
},
|
|
42
|
+
'&.react-grid-item.react-grid-placeholder': {
|
|
43
|
+
background: theme.palette.primary.main,
|
|
44
|
+
opacity: 0.2,
|
|
45
|
+
transitionDuration: '100ms',
|
|
46
|
+
zIndex: 2,
|
|
47
|
+
userSelect: 'none',
|
|
48
|
+
WebkitUserSelect: 'none',
|
|
49
|
+
MozUserSelect: 'none',
|
|
50
|
+
msUserSelect: 'none',
|
|
51
|
+
OUserSelect: 'none'
|
|
52
|
+
},
|
|
53
|
+
'&.react-grid-item > .react-resizable-handle': {
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
width: '20px',
|
|
56
|
+
height: '20px'
|
|
57
|
+
},
|
|
58
|
+
'&.react-grid-item > .react-resizable-handle::after': {
|
|
59
|
+
content: '""',
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
right: '3px',
|
|
62
|
+
bottom: '3px',
|
|
63
|
+
width: '5px',
|
|
64
|
+
height: '5px',
|
|
65
|
+
borderRight: '2px solid rgba(0, 0, 0, 0.4)',
|
|
66
|
+
borderBottom: '2px solid rgba(0, 0, 0, 0.4)'
|
|
67
|
+
},
|
|
68
|
+
'&.react-resizable-hide > .react-resizable-handle': {
|
|
69
|
+
display: 'none'
|
|
70
|
+
},
|
|
71
|
+
'&.react-grid-item > .react-resizable-handle.react-resizable-handle-sw': {
|
|
72
|
+
bottom: '0',
|
|
73
|
+
left: '0',
|
|
74
|
+
cursor: 'sw-resize',
|
|
75
|
+
transform: 'rotate(90deg)'
|
|
76
|
+
},
|
|
77
|
+
'&.react-grid-item > .react-resizable-handle.react-resizable-handle-se': {
|
|
78
|
+
bottom: '0',
|
|
79
|
+
right: '0',
|
|
80
|
+
cursor: 'se-resize'
|
|
81
|
+
},
|
|
82
|
+
'&.react-grid-item > .react-resizable-handle.react-resizable-handle-nw': {
|
|
83
|
+
top: '0',
|
|
84
|
+
left: '0',
|
|
85
|
+
cursor: 'nw-resize',
|
|
86
|
+
transform: 'rotate(180deg)'
|
|
87
|
+
},
|
|
88
|
+
'&.react-grid-item > .react-resizable-handle.react-resizable-handle-ne': {
|
|
89
|
+
top: '0',
|
|
90
|
+
right: '0',
|
|
91
|
+
cursor: 'ne-resize',
|
|
92
|
+
transform: 'rotate(270deg)'
|
|
93
|
+
},
|
|
94
|
+
'&.react-grid-item > .react-resizable-handle.react-resizable-handle-w, &.react-grid-item > .react-resizable-handle.react-resizable-handle-e': {
|
|
95
|
+
top: '50%',
|
|
96
|
+
marginTop: '-10px',
|
|
97
|
+
cursor: 'ew-resize'
|
|
98
|
+
},
|
|
99
|
+
'&.react-grid-item > .react-resizable-handle.react-resizable-handle-w': {
|
|
100
|
+
left: '0',
|
|
101
|
+
transform: 'rotate(135deg)'
|
|
102
|
+
},
|
|
103
|
+
'&.react-grid-item > .react-resizable-handle.react-resizable-handle-e': {
|
|
104
|
+
right: '0',
|
|
105
|
+
transform: 'rotate(315deg)'
|
|
106
|
+
},
|
|
107
|
+
'&.react-grid-item > .react-resizable-handle.react-resizable-handle-n, &.react-grid-item > .react-resizable-handle.react-resizable-handle-s': {
|
|
108
|
+
left: '50%',
|
|
109
|
+
marginLeft: '-10px',
|
|
110
|
+
cursor: 'ns-resize'
|
|
111
|
+
},
|
|
112
|
+
'&.react-grid-item > .react-resizable-handle.react-resizable-handle-n': {
|
|
113
|
+
top: '0',
|
|
114
|
+
transform: 'rotate(225deg)'
|
|
115
|
+
},
|
|
116
|
+
'&.react-grid-item > .react-resizable-handle.react-resizable-handle-s': {
|
|
117
|
+
bottom: '0',
|
|
118
|
+
transform: 'rotate(45deg)'
|
|
119
|
+
},
|
|
120
|
+
'&.react-resizable': {
|
|
121
|
+
position: 'relative'
|
|
122
|
+
},
|
|
123
|
+
'&.react-resizable-handle': {
|
|
124
|
+
position: 'absolute',
|
|
125
|
+
width: '20px',
|
|
126
|
+
height: '20px',
|
|
127
|
+
backgroundRepeat: 'no-repeat',
|
|
128
|
+
backgroundOrigin: 'content-box',
|
|
129
|
+
boxSizing: 'border-box',
|
|
130
|
+
backgroundImage: `url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+')`,
|
|
131
|
+
backgroundPosition: 'bottom right',
|
|
132
|
+
padding: '0 3px 3px 0'
|
|
133
|
+
},
|
|
134
|
+
'&.react-resizable-handle-sw': {
|
|
135
|
+
bottom: '0',
|
|
136
|
+
left: '0',
|
|
137
|
+
cursor: 'sw-resize',
|
|
138
|
+
transform: 'rotate(90deg)'
|
|
139
|
+
},
|
|
140
|
+
'&.react-resizable-handle-se': {
|
|
141
|
+
bottom: '0',
|
|
142
|
+
right: '0',
|
|
143
|
+
cursor: 'se-resize'
|
|
144
|
+
},
|
|
145
|
+
'&.react-resizable-handle-nw': {
|
|
146
|
+
top: '0',
|
|
147
|
+
left: '0',
|
|
148
|
+
cursor: 'nw-resize',
|
|
149
|
+
transform: 'rotate(180deg)'
|
|
150
|
+
},
|
|
151
|
+
'&.react-resizable-handle-ne': {
|
|
152
|
+
top: '0',
|
|
153
|
+
right: '0',
|
|
154
|
+
cursor: 'ne-resize',
|
|
155
|
+
transform: 'rotate(270deg)'
|
|
156
|
+
},
|
|
157
|
+
'&.react-resizable-handle-w, .react-resizable-handle-e': {
|
|
158
|
+
top: '50%',
|
|
159
|
+
marginTop: '-10px',
|
|
160
|
+
cursor: 'ew-resize'
|
|
161
|
+
},
|
|
162
|
+
'&.react-resizable-handle-w': {
|
|
163
|
+
left: '0',
|
|
164
|
+
transform: 'rotate(135deg)'
|
|
165
|
+
},
|
|
166
|
+
'&.react-resizable-handle-e': {
|
|
167
|
+
right: '0',
|
|
168
|
+
transform: 'rotate(315deg)'
|
|
169
|
+
},
|
|
170
|
+
'&.react-resizable-handle-n, .react-resizable-handle-s': {
|
|
171
|
+
left: '50%',
|
|
172
|
+
marginLeft: '-10px',
|
|
173
|
+
cursor: 'ns-resize'
|
|
174
|
+
},
|
|
175
|
+
'&.react-resizable-handle-n': {
|
|
176
|
+
top: '0',
|
|
177
|
+
transform: 'rotate(225deg)'
|
|
178
|
+
},
|
|
179
|
+
'&.react-resizable-handle-s': {
|
|
180
|
+
bottom: '0',
|
|
181
|
+
transform: 'rotate(45deg)'
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/css/styles.tsx"],"sourcesContent":["// Copyright 2022 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 { Theme } from '@mui/material';\n\nexport const styles = (theme: Theme) => {\n return {\n '&.react-grid-layout': {\n position: 'relative',\n transition: 'height 200ms ease',\n },\n '&.react-grid-item': {\n transition: 'all 200ms ease',\n transitionProperty: 'left, top',\n },\n '&.react-grid-item img': {\n pointerEvents: 'none',\n userSelect: 'none',\n },\n '&.react-grid-item.cssTransforms': {\n transitionProperty: 'transform',\n },\n '&.react-grid-item.resizing': {\n zIndex: 1,\n willChange: 'width, height',\n },\n '&.react-grid-item.react-draggable-dragging': {\n transition: 'none',\n zIndex: 3,\n willChange: 'transform',\n },\n '&.react-grid-item.dropping': {\n visibility: 'hidden',\n },\n '&.react-grid-item.react-grid-placeholder': {\n background: theme.palette.primary.main,\n opacity: 0.2,\n transitionDuration: '100ms',\n zIndex: 2,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n MozUserSelect: 'none',\n msUserSelect: 'none',\n OUserSelect: 'none',\n },\n\n '&.react-grid-item > .react-resizable-handle': {\n position: 'absolute',\n width: '20px',\n height: '20px',\n },\n '&.react-grid-item > .react-resizable-handle::after': {\n content: '\"\"',\n position: 'absolute',\n right: '3px',\n bottom: '3px',\n width: '5px',\n height: '5px',\n borderRight: '2px solid rgba(0, 0, 0, 0.4)',\n borderBottom: '2px solid rgba(0, 0, 0, 0.4)',\n },\n\n '&.react-resizable-hide > .react-resizable-handle': {\n display: 'none',\n },\n\n '&.react-grid-item > .react-resizable-handle.react-resizable-handle-sw': {\n bottom: '0',\n left: '0',\n cursor: 'sw-resize',\n transform: 'rotate(90deg)',\n },\n '&.react-grid-item > .react-resizable-handle.react-resizable-handle-se': {\n bottom: '0',\n right: '0',\n cursor: 'se-resize',\n },\n '&.react-grid-item > .react-resizable-handle.react-resizable-handle-nw': {\n top: '0',\n left: '0',\n cursor: 'nw-resize',\n transform: 'rotate(180deg)',\n },\n '&.react-grid-item > .react-resizable-handle.react-resizable-handle-ne': {\n top: '0',\n right: '0',\n cursor: 'ne-resize',\n transform: 'rotate(270deg)',\n },\n '&.react-grid-item > .react-resizable-handle.react-resizable-handle-w, &.react-grid-item > .react-resizable-handle.react-resizable-handle-e':\n {\n top: '50%',\n marginTop: '-10px',\n cursor: 'ew-resize',\n },\n '&.react-grid-item > .react-resizable-handle.react-resizable-handle-w': {\n left: '0',\n transform: 'rotate(135deg)',\n },\n '&.react-grid-item > .react-resizable-handle.react-resizable-handle-e': {\n right: '0',\n transform: 'rotate(315deg)',\n },\n '&.react-grid-item > .react-resizable-handle.react-resizable-handle-n, &.react-grid-item > .react-resizable-handle.react-resizable-handle-s':\n {\n left: '50%',\n marginLeft: '-10px',\n cursor: 'ns-resize',\n },\n '&.react-grid-item > .react-resizable-handle.react-resizable-handle-n': {\n top: '0',\n transform: 'rotate(225deg)',\n },\n '&.react-grid-item > .react-resizable-handle.react-resizable-handle-s': {\n bottom: '0',\n transform: 'rotate(45deg)',\n },\n '&.react-resizable': {\n position: 'relative',\n },\n '&.react-resizable-handle': {\n position: 'absolute',\n width: '20px',\n height: '20px',\n backgroundRepeat: 'no-repeat',\n backgroundOrigin: 'content-box',\n boxSizing: 'border-box',\n backgroundImage: `url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+')`,\n backgroundPosition: 'bottom right',\n padding: '0 3px 3px 0',\n },\n '&.react-resizable-handle-sw': {\n bottom: '0',\n left: '0',\n cursor: 'sw-resize',\n transform: 'rotate(90deg)',\n },\n '&.react-resizable-handle-se': {\n bottom: '0',\n right: '0',\n cursor: 'se-resize',\n },\n '&.react-resizable-handle-nw': {\n top: '0',\n left: '0',\n cursor: 'nw-resize',\n transform: 'rotate(180deg)',\n },\n '&.react-resizable-handle-ne': {\n top: '0',\n right: '0',\n cursor: 'ne-resize',\n transform: 'rotate(270deg)',\n },\n '&.react-resizable-handle-w, .react-resizable-handle-e': {\n top: '50%',\n marginTop: '-10px',\n cursor: 'ew-resize',\n },\n '&.react-resizable-handle-w': {\n left: '0',\n transform: 'rotate(135deg)',\n },\n '&.react-resizable-handle-e': {\n right: '0',\n transform: 'rotate(315deg)',\n },\n '&.react-resizable-handle-n, .react-resizable-handle-s': {\n left: '50%',\n marginLeft: '-10px',\n cursor: 'ns-resize',\n },\n '&.react-resizable-handle-n': {\n top: '0',\n transform: 'rotate(225deg)',\n },\n '&.react-resizable-handle-s': {\n bottom: '0',\n transform: 'rotate(45deg)',\n },\n } as const;\n};\n"],"names":["styles","theme","position","transition","transitionProperty","pointerEvents","userSelect","zIndex","willChange","visibility","background","palette","primary","main","opacity","transitionDuration","WebkitUserSelect","MozUserSelect","msUserSelect","OUserSelect","width","height","content","right","bottom","borderRight","borderBottom","display","left","cursor","transform","top","marginTop","marginLeft","backgroundRepeat","backgroundOrigin","boxSizing","backgroundImage","backgroundPosition","padding"],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright 2022 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
|
+
export * from './components';
|
|
14
|
+
export * from './context';
|
|
15
|
+
export * from './views';
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright 2022 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\nexport * from './components';\nexport * from './context';\nexport * from './views';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DashboardResource } from '@perses-dev/core';
|
|
2
|
+
import { StoreApi } from 'zustand';
|
|
3
|
+
import { DashboardStoreState } from '../context';
|
|
4
|
+
/**
|
|
5
|
+
* Helper to get a test dashboard resource.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getTestDashboard(): DashboardResource;
|
|
8
|
+
/**
|
|
9
|
+
* Test helper to create a "spy" component that will capture the DashboardProvider's store, allowing you to inspect
|
|
10
|
+
* its state in tests. Be sure to render the DashboardProviderSpy component that's returned in the component test
|
|
11
|
+
* underneath the DashboardProvider.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createDashboardProviderSpy(): {
|
|
14
|
+
DashboardProviderSpy: () => null;
|
|
15
|
+
store: {
|
|
16
|
+
value?: StoreApi<DashboardStoreState> | undefined;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=dashboard-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-provider.d.ts","sourceRoot":"","sources":["../../src/test/dashboard-provider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAoB,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGnE;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,iBAAiB,CAGpD;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B;;;;;EAczC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright 2022 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
|
+
import { useContext } from 'react';
|
|
14
|
+
import { DashboardContext } from '../context';
|
|
15
|
+
import testDashboard from './testDashboard';
|
|
16
|
+
/**
|
|
17
|
+
* Helper to get a test dashboard resource.
|
|
18
|
+
*/ export function getTestDashboard() {
|
|
19
|
+
// TODO: Should we be cloning this to create a new object each time?
|
|
20
|
+
return testDashboard;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Test helper to create a "spy" component that will capture the DashboardProvider's store, allowing you to inspect
|
|
24
|
+
* its state in tests. Be sure to render the DashboardProviderSpy component that's returned in the component test
|
|
25
|
+
* underneath the DashboardProvider.
|
|
26
|
+
*/ export function createDashboardProviderSpy() {
|
|
27
|
+
const store = {};
|
|
28
|
+
// Spy component just captures the store value so it can be inspected in tests
|
|
29
|
+
function DashboardProviderSpy() {
|
|
30
|
+
const ctx = useContext(DashboardContext);
|
|
31
|
+
store.value = ctx;
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
DashboardProviderSpy,
|
|
36
|
+
store
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=dashboard-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test/dashboard-provider.tsx"],"sourcesContent":["// Copyright 2022 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 { DashboardResource } from '@perses-dev/core';\nimport { useContext } from 'react';\nimport { StoreApi } from 'zustand';\nimport { DashboardContext, DashboardStoreState } from '../context';\nimport testDashboard from './testDashboard';\n\n/**\n * Helper to get a test dashboard resource.\n */\nexport function getTestDashboard(): DashboardResource {\n // TODO: Should we be cloning this to create a new object each time?\n return testDashboard;\n}\n\n/**\n * Test helper to create a \"spy\" component that will capture the DashboardProvider's store, allowing you to inspect\n * its state in tests. Be sure to render the DashboardProviderSpy component that's returned in the component test\n * underneath the DashboardProvider.\n */\nexport function createDashboardProviderSpy() {\n const store: { value?: StoreApi<DashboardStoreState> } = {};\n\n // Spy component just captures the store value so it can be inspected in tests\n function DashboardProviderSpy() {\n const ctx = useContext(DashboardContext);\n store.value = ctx;\n return null;\n }\n\n return {\n DashboardProviderSpy,\n store,\n };\n}\n"],"names":["useContext","DashboardContext","testDashboard","getTestDashboard","createDashboardProviderSpy","store","DashboardProviderSpy","ctx","value"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,UAAU,QAAQ,OAAO,CAAC;AAEnC,SAASC,gBAAgB,QAA6B,YAAY,CAAC;AACnE,OAAOC,aAAa,MAAM,iBAAiB,CAAC;AAE5C;;CAEC,GACD,OAAO,SAASC,gBAAgB,GAAsB;IACpD,oEAAoE;IACpE,OAAOD,aAAa,CAAC;AACvB,CAAC;AAED;;;;CAIC,GACD,OAAO,SAASE,0BAA0B,GAAG;IAC3C,MAAMC,KAAK,GAA8C,EAAE,AAAC;IAE5D,8EAA8E;IAC9E,SAASC,oBAAoB,GAAG;QAC9B,MAAMC,GAAG,GAAGP,UAAU,CAACC,gBAAgB,CAAC,AAAC;QACzCI,KAAK,CAACG,KAAK,GAAGD,GAAG,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACLD,oBAAoB;QACpBD,KAAK;KACN,CAAC;AACJ,CAAC"}
|
package/dist/test/index.d.ts
CHANGED
package/dist/test/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAaA,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAaA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC"}
|
package/dist/test/index.js
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright 2022 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
|
+
export * from './dashboard-provider';
|
|
14
|
+
export * from './plugin-registry';
|
|
15
|
+
export * from './render';
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test/index.ts"],"sourcesContent":["// Copyright 2022 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\nexport * from './dashboard-provider';\nexport * from './plugin-registry';\nexport * from './render';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PluginRegistryProps, PluginImplementation, PanelPlugin } from '@perses-dev/plugin-system';
|
|
1
|
+
import { PluginRegistryProps, PluginImplementation, PluginType, PanelPlugin } from '@perses-dev/plugin-system';
|
|
3
2
|
/**
|
|
4
3
|
* Helper for mocking `PluginRegistry` data during tests. Returns props that can be spread on the `PluginRegistry`
|
|
5
4
|
* component so that it will load the mock plugins you setup. You can use the `addMockPlugin` function that's returned
|
|
@@ -7,7 +6,7 @@ import { PluginRegistryProps, PluginImplementation, PanelPlugin } from '@perses-
|
|
|
7
6
|
*/
|
|
8
7
|
export declare function mockPluginRegistryProps(): {
|
|
9
8
|
pluginRegistryProps: Omit<PluginRegistryProps, "children">;
|
|
10
|
-
addMockPlugin: <T extends
|
|
9
|
+
addMockPlugin: <T extends PluginType>(pluginType: T, kind: string, plugin: PluginImplementation<T>) => void;
|
|
11
10
|
};
|
|
12
|
-
export declare const FAKE_PANEL_PLUGIN: PanelPlugin
|
|
11
|
+
export declare const FAKE_PANEL_PLUGIN: PanelPlugin;
|
|
13
12
|
//# sourceMappingURL=plugin-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-registry.d.ts","sourceRoot":"","sources":["../../src/test/plugin-registry.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-registry.d.ts","sourceRoot":"","sources":["../../src/test/plugin-registry.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,mBAAmB,EAEnB,oBAAoB,EACpB,UAAU,EACV,WAAW,EAEZ,MAAM,2BAA2B,CAAC;AAEnC;;;;GAIG;AACH,wBAAgB,uBAAuB;;+DAiB6B,MAAM;EA0BzE;AAED,eAAO,MAAM,iBAAiB,EAAE,WAQ/B,CAAC"}
|
|
@@ -1 +1,74 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright 2022 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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
/**
|
|
15
|
+
* Helper for mocking `PluginRegistry` data during tests. Returns props that can be spread on the `PluginRegistry`
|
|
16
|
+
* component so that it will load the mock plugins you setup. You can use the `addMockPlugin` function that's returned
|
|
17
|
+
* to add mock plugins before rendering components that use them.
|
|
18
|
+
*/ export function mockPluginRegistryProps() {
|
|
19
|
+
const mockPluginResource = {
|
|
20
|
+
kind: 'PluginModule',
|
|
21
|
+
metadata: {
|
|
22
|
+
name: 'Fake Plugin Module for Tests',
|
|
23
|
+
created_at: '',
|
|
24
|
+
updated_at: '',
|
|
25
|
+
version: 0
|
|
26
|
+
},
|
|
27
|
+
spec: {
|
|
28
|
+
plugins: []
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const mockPluginModule = {};
|
|
32
|
+
// Allow adding mock plugins in tests
|
|
33
|
+
const addMockPlugin = (pluginType, kind, plugin)=>{
|
|
34
|
+
mockPluginResource.spec.plugins.push({
|
|
35
|
+
pluginType,
|
|
36
|
+
kind,
|
|
37
|
+
display: {
|
|
38
|
+
name: `Fake ${pluginType} Plugin for ${kind}`
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
// "Export" on the module under the same name as the kind the plugin handles
|
|
42
|
+
mockPluginModule[kind] = plugin;
|
|
43
|
+
};
|
|
44
|
+
const pluginRegistryProps = {
|
|
45
|
+
getInstalledPlugins () {
|
|
46
|
+
return Promise.resolve([
|
|
47
|
+
mockPluginResource
|
|
48
|
+
]);
|
|
49
|
+
},
|
|
50
|
+
importPluginModule () {
|
|
51
|
+
return Promise.resolve(mockPluginModule);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
pluginRegistryProps,
|
|
56
|
+
addMockPlugin
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export const FAKE_PANEL_PLUGIN = {
|
|
60
|
+
PanelComponent: ()=>{
|
|
61
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
62
|
+
role: "figure",
|
|
63
|
+
children: "FakePanel chart"
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
OptionsEditorComponent: ()=>{
|
|
67
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
68
|
+
children: "Edit options here"
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
createInitialOptions: ()=>({})
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=plugin-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test/plugin-registry.tsx"],"sourcesContent":["// Copyright 2022 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.\nimport { UnknownSpec } from '@perses-dev/core';\nimport {\n PluginRegistryProps,\n PluginModuleResource,\n PluginImplementation,\n PluginType,\n PanelPlugin,\n Plugin,\n} from '@perses-dev/plugin-system';\n\n/**\n * Helper for mocking `PluginRegistry` data during tests. Returns props that can be spread on the `PluginRegistry`\n * component so that it will load the mock plugins you setup. You can use the `addMockPlugin` function that's returned\n * to add mock plugins before rendering components that use them.\n */\nexport function mockPluginRegistryProps() {\n const mockPluginResource: PluginModuleResource = {\n kind: 'PluginModule',\n metadata: {\n name: 'Fake Plugin Module for Tests',\n created_at: '',\n updated_at: '',\n version: 0,\n },\n spec: {\n plugins: [],\n },\n };\n\n const mockPluginModule: Record<string, Plugin<UnknownSpec>> = {};\n\n // Allow adding mock plugins in tests\n const addMockPlugin = <T extends PluginType>(pluginType: T, kind: string, plugin: PluginImplementation<T>) => {\n mockPluginResource.spec.plugins.push({\n pluginType,\n kind,\n display: {\n name: `Fake ${pluginType} Plugin for ${kind}`,\n },\n });\n\n // \"Export\" on the module under the same name as the kind the plugin handles\n mockPluginModule[kind] = plugin;\n };\n\n const pluginRegistryProps: Omit<PluginRegistryProps, 'children'> = {\n getInstalledPlugins() {\n return Promise.resolve([mockPluginResource]);\n },\n importPluginModule(/* resource */) {\n return Promise.resolve(mockPluginModule);\n },\n };\n\n return {\n pluginRegistryProps,\n addMockPlugin,\n };\n}\n\nexport const FAKE_PANEL_PLUGIN: PanelPlugin = {\n PanelComponent: () => {\n return <div role=\"figure\">FakePanel chart</div>;\n },\n OptionsEditorComponent: () => {\n return <div>Edit options here</div>;\n },\n createInitialOptions: () => ({}),\n};\n"],"names":["mockPluginRegistryProps","mockPluginResource","kind","metadata","name","created_at","updated_at","version","spec","plugins","mockPluginModule","addMockPlugin","pluginType","plugin","push","display","pluginRegistryProps","getInstalledPlugins","Promise","resolve","importPluginModule","FAKE_PANEL_PLUGIN","PanelComponent","div","role","OptionsEditorComponent","createInitialOptions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC;AAUA;;;;CAIC,GACD,OAAO,SAASA,uBAAuB,GAAG;IACxC,MAAMC,kBAAkB,GAAyB;QAC/CC,IAAI,EAAE,cAAc;QACpBC,QAAQ,EAAE;YACRC,IAAI,EAAE,8BAA8B;YACpCC,UAAU,EAAE,EAAE;YACdC,UAAU,EAAE,EAAE;YACdC,OAAO,EAAE,CAAC;SACX;QACDC,IAAI,EAAE;YACJC,OAAO,EAAE,EAAE;SACZ;KACF,AAAC;IAEF,MAAMC,gBAAgB,GAAwC,EAAE,AAAC;IAEjE,qCAAqC;IACrC,MAAMC,aAAa,GAAG,CAAuBC,UAAa,EAAEV,IAAY,EAAEW,MAA+B,GAAK;QAC5GZ,kBAAkB,CAACO,IAAI,CAACC,OAAO,CAACK,IAAI,CAAC;YACnCF,UAAU;YACVV,IAAI;YACJa,OAAO,EAAE;gBACPX,IAAI,EAAE,CAAC,KAAK,EAAEQ,UAAU,CAAC,YAAY,EAAEV,IAAI,CAAC,CAAC;aAC9C;SACF,CAAC,CAAC;QAEH,4EAA4E;QAC5EQ,gBAAgB,CAACR,IAAI,CAAC,GAAGW,MAAM,CAAC;IAClC,CAAC,AAAC;IAEF,MAAMG,mBAAmB,GAA0C;QACjEC,mBAAmB,IAAG;YACpB,OAAOC,OAAO,CAACC,OAAO,CAAC;gBAAClB,kBAAkB;aAAC,CAAC,CAAC;QAC/C,CAAC;QACDmB,kBAAkB,IAAiB;YACjC,OAAOF,OAAO,CAACC,OAAO,CAACT,gBAAgB,CAAC,CAAC;QAC3C,CAAC;KACF,AAAC;IAEF,OAAO;QACLM,mBAAmB;QACnBL,aAAa;KACd,CAAC;AACJ,CAAC;AAED,OAAO,MAAMU,iBAAiB,GAAgB;IAC5CC,cAAc,EAAE,IAAM;QACpB,qBAAO,KAACC,KAAG;YAACC,IAAI,EAAC,QAAQ;sBAAC,iBAAe;UAAM,CAAC;IAClD,CAAC;IACDC,sBAAsB,EAAE,IAAM;QAC5B,qBAAO,KAACF,KAAG;sBAAC,mBAAiB;UAAM,CAAC;IACtC,CAAC;IACDG,oBAAoB,EAAE,IAAO,CAAA,EAAE,CAAA,AAAC;CACjC,CAAC"}
|
package/dist/test/render.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RenderOptions } from '@testing-library/react';
|
|
3
|
-
import { DashboardStoreProps } from '../context';
|
|
4
3
|
/**
|
|
5
4
|
* Test helper to render a React component with some common app-level providers wrapped around it.
|
|
6
5
|
*/
|
|
7
|
-
export declare function renderWithContext(ui: React.ReactElement,
|
|
6
|
+
export declare function renderWithContext(ui: React.ReactElement, options?: Omit<RenderOptions, 'queries'>): import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
8
7
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/test/render.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAU,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/test/render.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAU,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG/D;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,gIAIjG"}
|
package/dist/test/render.js
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright 2022 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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { render } from '@testing-library/react';
|
|
15
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
16
|
+
/**
|
|
17
|
+
* Test helper to render a React component with some common app-level providers wrapped around it.
|
|
18
|
+
*/ export function renderWithContext(ui, options) {
|
|
19
|
+
// Create a new QueryClient for each test to avoid caching issues
|
|
20
|
+
const queryClient = new QueryClient({
|
|
21
|
+
defaultOptions: {
|
|
22
|
+
queries: {
|
|
23
|
+
refetchOnWindowFocus: false,
|
|
24
|
+
retry: false
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return render(/*#__PURE__*/ _jsx(QueryClientProvider, {
|
|
29
|
+
client: queryClient,
|
|
30
|
+
children: ui
|
|
31
|
+
}), options);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test/render.tsx"],"sourcesContent":["// Copyright 2022 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 { render, RenderOptions } from '@testing-library/react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\n\n/**\n * Test helper to render a React component with some common app-level providers wrapped around it.\n */\nexport function renderWithContext(ui: React.ReactElement, options?: Omit<RenderOptions, 'queries'>) {\n // Create a new QueryClient for each test to avoid caching issues\n const queryClient = new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false, retry: false } } });\n return render(<QueryClientProvider client={queryClient}>{ui}</QueryClientProvider>, options);\n}\n"],"names":["render","QueryClient","QueryClientProvider","renderWithContext","ui","options","queryClient","defaultOptions","queries","refetchOnWindowFocus","retry","client"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,MAAM,QAAuB,wBAAwB,CAAC;AAC/D,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,uBAAuB,CAAC;AAEzE;;CAEC,GACD,OAAO,SAASC,iBAAiB,CAACC,EAAsB,EAAEC,OAAwC,EAAE;IAClG,iEAAiE;IACjE,MAAMC,WAAW,GAAG,IAAIL,WAAW,CAAC;QAAEM,cAAc,EAAE;YAAEC,OAAO,EAAE;gBAAEC,oBAAoB,EAAE,KAAK;gBAAEC,KAAK,EAAE,KAAK;aAAE;SAAE;KAAE,CAAC,AAAC;IACpH,OAAOV,MAAM,eAAC,KAACE,mBAAmB;QAACS,MAAM,EAAEL,WAAW;kBAAGF,EAAE;MAAuB,EAAEC,OAAO,CAAC,CAAC;AAC/F,CAAC"}
|
package/dist/test/setup-tests.js
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright 2022 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
|
+
// Add testing library assertions
|
|
14
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
15
|
+
// Always mock e-charts during tests since we don't have a proper canvas in jsdom
|
|
16
|
+
jest.mock('echarts/core');
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=setup-tests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test/setup-tests.ts"],"sourcesContent":["// Copyright 2022 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\n// Add testing library assertions\nimport '@testing-library/jest-dom/extend-expect';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n"],"names":["jest","mock"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,iCAAiC;AACjC,OAAO,yCAAyC,CAAC;AAEjD,iFAAiF;AACjFA,IAAI,CAACC,IAAI,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testDashboard.d.ts","sourceRoot":"","sources":["../../src/test/testDashboard.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,QAAA,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"testDashboard.d.ts","sourceRoot":"","sources":["../../src/test/testDashboard.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,QAAA,MAAM,aAAa,EAAE,iBAwPpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|