@grafana/plugin-ui 0.1.10
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/README.md +45 -0
- package/dist/8x/fixtures/index.js +7 -0
- package/dist/8x/fixtures/index.js.map +1 -0
- package/dist/8x/fixtures/select.js +43 -0
- package/dist/8x/fixtures/select.js.map +1 -0
- package/dist/8x/index.js +5 -0
- package/dist/8x/index.js.map +1 -0
- package/dist/components/AsyncButtonCascader/AsyncButtonCascader.js +34 -0
- package/dist/components/AsyncButtonCascader/AsyncButtonCascader.js.map +1 -0
- package/dist/components/Cascader/Cascader.js +6 -0
- package/dist/components/Cascader/Cascader.js.map +1 -0
- package/dist/components/DataLinks/DataLink.js +79 -0
- package/dist/components/DataLinks/DataLink.js.map +1 -0
- package/dist/components/DataLinks/DataLinks.js +59 -0
- package/dist/components/DataLinks/DataLinks.js.map +1 -0
- package/dist/components/DataLinks/index.js +7 -0
- package/dist/components/DataLinks/index.js.map +1 -0
- package/dist/components/DataLinks/types.js +3 -0
- package/dist/components/DataLinks/types.js.map +1 -0
- package/dist/components/DataSourcePicker/DataSourcePicker.js +90 -0
- package/dist/components/DataSourcePicker/DataSourcePicker.js.map +1 -0
- package/dist/components/DatePicker/DatePicker.js +29 -0
- package/dist/components/DatePicker/DatePicker.js.map +1 -0
- package/dist/components/DatePicker/styles.js +156 -0
- package/dist/components/DatePicker/styles.js.map +1 -0
- package/dist/components/DatePickerWithInput/DatePickerWithInput.js +19 -0
- package/dist/components/DatePickerWithInput/DatePickerWithInput.js.map +1 -0
- package/dist/components/DatePickerWithInput/style.css +6 -0
- package/dist/components/DebounceInput/DebounceInput.js +17 -0
- package/dist/components/DebounceInput/DebounceInput.js.map +1 -0
- package/dist/components/Plugins/PluginSignatureBadge.js +65 -0
- package/dist/components/Plugins/PluginSignatureBadge.js.map +1 -0
- package/dist/components/QueryEditor/AccessoryButton.js +21 -0
- package/dist/components/QueryEditor/AccessoryButton.js.map +1 -0
- package/dist/components/QueryEditor/ConfirmModal.js +28 -0
- package/dist/components/QueryEditor/ConfirmModal.js.map +1 -0
- package/dist/components/QueryEditor/DatasetSelector.js +36 -0
- package/dist/components/QueryEditor/DatasetSelector.js.map +1 -0
- package/dist/components/QueryEditor/EditorField.js +51 -0
- package/dist/components/QueryEditor/EditorField.js.map +1 -0
- package/dist/components/QueryEditor/EditorFieldGroup.js +11 -0
- package/dist/components/QueryEditor/EditorFieldGroup.js.map +1 -0
- package/dist/components/QueryEditor/EditorHeader.js +23 -0
- package/dist/components/QueryEditor/EditorHeader.js.map +1 -0
- package/dist/components/QueryEditor/EditorList.js +28 -0
- package/dist/components/QueryEditor/EditorList.js.map +1 -0
- package/dist/components/QueryEditor/EditorRow.js +24 -0
- package/dist/components/QueryEditor/EditorRow.js.map +1 -0
- package/dist/components/QueryEditor/EditorRows.js +11 -0
- package/dist/components/QueryEditor/EditorRows.js.map +1 -0
- package/dist/components/QueryEditor/EditorSwitch.js +24 -0
- package/dist/components/QueryEditor/EditorSwitch.js.map +1 -0
- package/dist/components/QueryEditor/ErrorBoundary.js +23 -0
- package/dist/components/QueryEditor/ErrorBoundary.js.map +1 -0
- package/dist/components/QueryEditor/FlexItem.js +10 -0
- package/dist/components/QueryEditor/FlexItem.js.map +1 -0
- package/dist/components/QueryEditor/InlineSelect.js +60 -0
- package/dist/components/QueryEditor/InlineSelect.js.map +1 -0
- package/dist/components/QueryEditor/InputGroup.js +46 -0
- package/dist/components/QueryEditor/InputGroup.js.map +1 -0
- package/dist/components/QueryEditor/QueryEditor.js +73 -0
- package/dist/components/QueryEditor/QueryEditor.js.map +1 -0
- package/dist/components/QueryEditor/QueryHeader.js +92 -0
- package/dist/components/QueryEditor/QueryHeader.js.map +1 -0
- package/dist/components/QueryEditor/Space.js +36 -0
- package/dist/components/QueryEditor/Space.js.map +1 -0
- package/dist/components/QueryEditor/Stack.js +27 -0
- package/dist/components/QueryEditor/Stack.js.map +1 -0
- package/dist/components/QueryEditor/TableSelector.js +20 -0
- package/dist/components/QueryEditor/TableSelector.js.map +1 -0
- package/dist/components/QueryEditor/defaults.js +20 -0
- package/dist/components/QueryEditor/defaults.js.map +1 -0
- package/dist/components/QueryEditor/expressions.js +18 -0
- package/dist/components/QueryEditor/expressions.js.map +1 -0
- package/dist/components/QueryEditor/index.js +35 -0
- package/dist/components/QueryEditor/index.js.map +1 -0
- package/dist/components/QueryEditor/query-editor-raw/QueryEditorRaw.js +21 -0
- package/dist/components/QueryEditor/query-editor-raw/QueryEditorRaw.js.map +1 -0
- package/dist/components/QueryEditor/query-editor-raw/QueryToolbox.js +59 -0
- package/dist/components/QueryEditor/query-editor-raw/QueryToolbox.js.map +1 -0
- package/dist/components/QueryEditor/query-editor-raw/QueryValidator.js +79 -0
- package/dist/components/QueryEditor/query-editor-raw/QueryValidator.js.map +1 -0
- package/dist/components/QueryEditor/query-editor-raw/RawEditor.js +60 -0
- package/dist/components/QueryEditor/query-editor-raw/RawEditor.js.map +1 -0
- package/dist/components/QueryEditor/types.js +21 -0
- package/dist/components/QueryEditor/types.js.map +1 -0
- package/dist/components/QueryEditor/utils/formatSQL.js +13 -0
- package/dist/components/QueryEditor/utils/formatSQL.js.map +1 -0
- package/dist/components/QueryEditor/utils/sql.utils.js +94 -0
- package/dist/components/QueryEditor/utils/sql.utils.js.map +1 -0
- package/dist/components/QueryEditor/utils/useSqlChange.js +16 -0
- package/dist/components/QueryEditor/utils/useSqlChange.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/AwesomeQueryBuilder.js +109 -0
- package/dist/components/QueryEditor/visual-query-builder/AwesomeQueryBuilder.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/EditorField.js +51 -0
- package/dist/components/QueryEditor/visual-query-builder/EditorField.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/EditorRow.js +24 -0
- package/dist/components/QueryEditor/visual-query-builder/EditorRow.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/EditorRows.js +11 -0
- package/dist/components/QueryEditor/visual-query-builder/EditorRows.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/GroupByRow.js +33 -0
- package/dist/components/QueryEditor/visual-query-builder/GroupByRow.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/OrderByRow.js +50 -0
- package/dist/components/QueryEditor/visual-query-builder/OrderByRow.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/Preview.js +28 -0
- package/dist/components/QueryEditor/visual-query-builder/Preview.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/SQLGroupByRow.js +13 -0
- package/dist/components/QueryEditor/visual-query-builder/SQLGroupByRow.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/SQLOrderByRow.js +34 -0
- package/dist/components/QueryEditor/visual-query-builder/SQLOrderByRow.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/SQLSelectRow.js +19 -0
- package/dist/components/QueryEditor/visual-query-builder/SQLSelectRow.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/SQLWhereRow.js +35 -0
- package/dist/components/QueryEditor/visual-query-builder/SQLWhereRow.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/SelectRow.js +68 -0
- package/dist/components/QueryEditor/visual-query-builder/SelectRow.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/Stack.js +27 -0
- package/dist/components/QueryEditor/visual-query-builder/Stack.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/VisualEditor.js +38 -0
- package/dist/components/QueryEditor/visual-query-builder/VisualEditor.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/WhereRow.js +67 -0
- package/dist/components/QueryEditor/visual-query-builder/WhereRow.js.map +1 -0
- package/dist/components/QueryEditor/visual-query-builder/index.js +6 -0
- package/dist/components/QueryEditor/visual-query-builder/index.js.map +1 -0
- package/dist/components/QueryEditorRow/QueryEditorRow.js +17 -0
- package/dist/components/QueryEditorRow/QueryEditorRow.js.map +1 -0
- package/dist/components/Segment/Segment.js +18 -0
- package/dist/components/Segment/Segment.js.map +1 -0
- package/dist/components/index.js +25 -0
- package/dist/components/index.js.map +1 -0
- package/dist/datasource/SqlDatasource.js +161 -0
- package/dist/datasource/SqlDatasource.js.map +1 -0
- package/dist/datasource/constants.js +19 -0
- package/dist/datasource/constants.js.map +1 -0
- package/dist/hooks/useDebounce.js +19 -0
- package/dist/hooks/useDebounce.js.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/src/8x/fixtures/index.d.ts +1 -0
- package/dist/src/8x/fixtures/select.d.ts +11 -0
- package/dist/src/8x/index.d.ts +1 -0
- package/dist/src/components/AsyncButtonCascader/AsyncButtonCascader.d.ts +18 -0
- package/dist/src/components/Cascader/Cascader.d.ts +1 -0
- package/dist/src/components/DataLinks/DataLink.d.ts +13 -0
- package/dist/src/components/DataLinks/DataLinks.d.ts +8 -0
- package/dist/src/components/DataLinks/index.d.ts +3 -0
- package/dist/src/components/DataLinks/types.d.ts +7 -0
- package/dist/src/components/DataSourcePicker/DataSourcePicker.d.ts +34 -0
- package/dist/src/components/DatePicker/DatePicker.d.ts +8 -0
- package/dist/src/components/DatePicker/styles.d.ts +11 -0
- package/dist/src/components/DatePickerWithInput/DatePickerWithInput.d.ts +9 -0
- package/dist/src/components/DebounceInput/DebounceInput.d.ts +8 -0
- package/dist/src/components/Plugins/PluginSignatureBadge.d.ts +9 -0
- package/dist/src/components/QueryEditor/AccessoryButton.d.ts +6 -0
- package/dist/src/components/QueryEditor/ConfirmModal.d.ts +9 -0
- package/dist/src/components/QueryEditor/DatasetSelector.d.ts +12 -0
- package/dist/src/components/QueryEditor/EditorField.d.ts +11 -0
- package/dist/src/components/QueryEditor/EditorFieldGroup.d.ts +5 -0
- package/dist/src/components/QueryEditor/EditorHeader.d.ts +5 -0
- package/dist/src/components/QueryEditor/EditorList.d.ts +8 -0
- package/dist/src/components/QueryEditor/EditorRow.d.ts +5 -0
- package/dist/src/components/QueryEditor/EditorRows.d.ts +5 -0
- package/dist/src/components/QueryEditor/EditorSwitch.d.ts +3 -0
- package/dist/src/components/QueryEditor/ErrorBoundary.d.ts +14 -0
- package/dist/src/components/QueryEditor/FlexItem.d.ts +7 -0
- package/dist/src/components/QueryEditor/InlineSelect.d.ts +7 -0
- package/dist/src/components/QueryEditor/InputGroup.d.ts +5 -0
- package/dist/src/components/QueryEditor/QueryEditor.d.ts +7 -0
- package/dist/src/components/QueryEditor/QueryHeader.d.ts +15 -0
- package/dist/src/components/QueryEditor/Space.d.ts +14 -0
- package/dist/src/components/QueryEditor/Stack.d.ts +9 -0
- package/dist/src/components/QueryEditor/TableSelector.d.ts +12 -0
- package/dist/src/components/QueryEditor/defaults.d.ts +3 -0
- package/dist/src/components/QueryEditor/expressions.d.ts +50 -0
- package/dist/src/components/QueryEditor/index.d.ts +16 -0
- package/dist/src/components/QueryEditor/query-editor-raw/QueryEditorRaw.d.ts +15 -0
- package/dist/src/components/QueryEditor/query-editor-raw/QueryToolbox.d.ts +11 -0
- package/dist/src/components/QueryEditor/query-editor-raw/QueryValidator.d.ts +10 -0
- package/dist/src/components/QueryEditor/query-editor-raw/RawEditor.d.ts +10 -0
- package/dist/src/components/QueryEditor/types.d.ts +149 -0
- package/dist/src/components/QueryEditor/utils/formatSQL.d.ts +1 -0
- package/dist/src/components/QueryEditor/utils/sql.utils.d.ts +13 -0
- package/dist/src/components/QueryEditor/utils/useSqlChange.d.ts +10 -0
- package/dist/src/components/QueryEditor/visual-query-builder/AwesomeQueryBuilder.d.ts +7 -0
- package/dist/src/components/QueryEditor/visual-query-builder/EditorField.d.ts +11 -0
- package/dist/src/components/QueryEditor/visual-query-builder/EditorRow.d.ts +5 -0
- package/dist/src/components/QueryEditor/visual-query-builder/EditorRows.d.ts +5 -0
- package/dist/src/components/QueryEditor/visual-query-builder/GroupByRow.d.ts +10 -0
- package/dist/src/components/QueryEditor/visual-query-builder/OrderByRow.d.ts +11 -0
- package/dist/src/components/QueryEditor/visual-query-builder/Preview.d.ts +6 -0
- package/dist/src/components/QueryEditor/visual-query-builder/SQLGroupByRow.d.ts +12 -0
- package/dist/src/components/QueryEditor/visual-query-builder/SQLOrderByRow.d.ts +12 -0
- package/dist/src/components/QueryEditor/visual-query-builder/SQLSelectRow.d.ts +12 -0
- package/dist/src/components/QueryEditor/visual-query-builder/SQLWhereRow.d.ts +12 -0
- package/dist/src/components/QueryEditor/visual-query-builder/SelectRow.d.ts +11 -0
- package/dist/src/components/QueryEditor/visual-query-builder/Stack.d.ts +9 -0
- package/dist/src/components/QueryEditor/visual-query-builder/VisualEditor.d.ts +14 -0
- package/dist/src/components/QueryEditor/visual-query-builder/WhereRow.d.ts +10 -0
- package/dist/src/components/QueryEditor/visual-query-builder/index.d.ts +1 -0
- package/dist/src/components/QueryEditorRow/QueryEditorRow.d.ts +8 -0
- package/dist/src/components/Segment/Segment.d.ts +8 -0
- package/dist/src/components/index.d.ts +11 -0
- package/dist/src/datasource/SqlDatasource.d.ts +64 -0
- package/dist/src/datasource/constants.d.ts +1 -0
- package/dist/src/hooks/useDebounce.d.ts +2 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/test/mocks/DataQuery.d.ts +2 -0
- package/dist/src/test/mocks/Datasource.d.ts +4 -0
- package/dist/src/test/mocks/Plugin.d.ts +10 -0
- package/dist/src/test/mocks/QueryEditorProps.d.ts +4 -0
- package/dist/src/test/mocks/TestDatasource.d.ts +6 -0
- package/dist/src/test/mocks/index.d.ts +5 -0
- package/dist/src/test/mocks/style.d.ts +1 -0
- package/dist/src/test/mocks/utils.d.ts +18 -0
- package/dist/src/test/setupTests.d.ts +1 -0
- package/dist/src/unreleasedComponents/index.d.ts +1 -0
- package/dist/src/utils/compatFeatures.d.ts +9 -0
- package/dist/src/utils/compatibility.d.ts +12 -0
- package/dist/src/utils/index.d.ts +3 -0
- package/dist/src/utils/testDatasource.d.ts +19 -0
- package/dist/test/mocks/DataQuery.js +14 -0
- package/dist/test/mocks/DataQuery.js.map +1 -0
- package/dist/test/mocks/Datasource.js +73 -0
- package/dist/test/mocks/Datasource.js.map +1 -0
- package/dist/test/mocks/Plugin.js +114 -0
- package/dist/test/mocks/Plugin.js.map +1 -0
- package/dist/test/mocks/QueryEditorProps.js +47 -0
- package/dist/test/mocks/QueryEditorProps.js.map +1 -0
- package/dist/test/mocks/TestDatasource.js +24 -0
- package/dist/test/mocks/TestDatasource.js.map +1 -0
- package/dist/test/mocks/index.js +9 -0
- package/dist/test/mocks/index.js.map +1 -0
- package/dist/test/mocks/style.js +5 -0
- package/dist/test/mocks/style.js.map +1 -0
- package/dist/test/mocks/utils.js +48 -0
- package/dist/test/mocks/utils.js.map +1 -0
- package/dist/test/setupTests.js +17 -0
- package/dist/test/setupTests.js.map +1 -0
- package/dist/unreleasedComponents/index.js +3 -0
- package/dist/unreleasedComponents/index.js.map +1 -0
- package/dist/utils/compatFeatures.js +20 -0
- package/dist/utils/compatFeatures.js.map +1 -0
- package/dist/utils/compatibility.js +28 -0
- package/dist/utils/compatibility.js.map +1 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/testDatasource.js +30 -0
- package/dist/utils/testDatasource.js.map +1 -0
- package/package.json +62 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateOptions = exports.selectOption = exports.SqlDatasource = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/**
|
|
6
|
+
* A library containing the different design components of the Grafana plugins ecosystem.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
tslib_1.__exportStar(require("./components"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./unreleasedComponents"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./test/mocks"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./utils"), exports);
|
|
14
|
+
var SqlDatasource_1 = require("./datasource/SqlDatasource");
|
|
15
|
+
Object.defineProperty(exports, "SqlDatasource", { enumerable: true, get: function () { return SqlDatasource_1.SqlDatasource; } });
|
|
16
|
+
var _8x_1 = require("./8x");
|
|
17
|
+
Object.defineProperty(exports, "selectOption", { enumerable: true, get: function () { return _8x_1.selectOption; } });
|
|
18
|
+
Object.defineProperty(exports, "generateOptions", { enumerable: true, get: function () { return _8x_1.generateOptions; } });
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA;;;;GAIG;AACH,uDAA6B;AAC7B,iEAAuC;AACvC,uDAA6B;AAC7B,kDAAwB;AACxB,4DAA2D;AAAlD,8GAAA,aAAa,OAAA;AACtB,4BAAqD;AAA5C,mGAAA,YAAY,OAAA;AAAE,sGAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { selectOption, generateOptions } from './select';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SelectableValue } from '@grafana/data';
|
|
2
|
+
export declare const generateOptions: () => Array<SelectableValue<string>>;
|
|
3
|
+
/**
|
|
4
|
+
* react-select (used by @grafana/ui) renders very differently from the native Select HTML element
|
|
5
|
+
* and because they do not pass data-testid down, it is difficult to grab the
|
|
6
|
+
* correct element and simulate selecting different options
|
|
7
|
+
* created a helper function to click and select a different option manually
|
|
8
|
+
* @param optionLabel
|
|
9
|
+
* @param index If there are multiple inputs and you don't want the first one taken, then pass in the index
|
|
10
|
+
*/
|
|
11
|
+
export declare const selectOption: (optionLabel: string, index?: number, role?: string) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fixtures';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CascaderOption } from 'rc-cascader';
|
|
3
|
+
export interface AsyncButtonCascaderProps {
|
|
4
|
+
options: CascaderOption[];
|
|
5
|
+
children: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
value: string[];
|
|
8
|
+
fieldNames?: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
children: string;
|
|
12
|
+
};
|
|
13
|
+
loadData?: (selectedOptions: CascaderOption[]) => void;
|
|
14
|
+
onChange?: (value: string[], selectedOptions: CascaderOption[]) => void;
|
|
15
|
+
onPopupVisibleChange?: (visible: boolean) => void;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const AsyncButtonCascader: React.FC<AsyncButtonCascaderProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Cascader } from '@grafana/ui';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { VariableSuggestion, DataSourceInstanceSettings, DataSourceJsonData } from '@grafana/data';
|
|
3
|
+
import { DataLinkConfig } from './types';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
value: DataLinkConfig;
|
|
6
|
+
datasources?: DataSourceInstanceSettings<DataSourceJsonData>[];
|
|
7
|
+
onChange: (value: DataLinkConfig) => void;
|
|
8
|
+
onDelete: () => void;
|
|
9
|
+
suggestions: VariableSuggestion[];
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const DataLink: (props: Props) => JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PureComponent } from 'react';
|
|
2
|
+
import { DataSourceInstanceSettings, SelectableValue } from '@grafana/data';
|
|
3
|
+
import { DataSourceSrv } from '@grafana/runtime';
|
|
4
|
+
export interface Props {
|
|
5
|
+
onChange: (ds: DataSourceInstanceSettings) => void;
|
|
6
|
+
current: string | null;
|
|
7
|
+
hideTextValue?: boolean;
|
|
8
|
+
onBlur?: () => void;
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
openMenuOnFocus?: boolean;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
tracing?: boolean;
|
|
13
|
+
mixed?: boolean;
|
|
14
|
+
dashboard?: boolean;
|
|
15
|
+
metrics?: boolean;
|
|
16
|
+
annotations?: boolean;
|
|
17
|
+
variables?: boolean;
|
|
18
|
+
pluginId?: string;
|
|
19
|
+
noDefault?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface State {
|
|
22
|
+
error?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare class DataSourcePicker extends PureComponent<Props, State> {
|
|
25
|
+
dataSourceSrv: DataSourceSrv;
|
|
26
|
+
static defaultProps: Partial<Props>;
|
|
27
|
+
state: State;
|
|
28
|
+
constructor(props: Props);
|
|
29
|
+
componentDidMount(): void;
|
|
30
|
+
onChange: (item: SelectableValue<string>) => void;
|
|
31
|
+
private getCurrentValue;
|
|
32
|
+
getDataSourceOptions(): Array<SelectableValue<string>>;
|
|
33
|
+
render(): JSX.Element;
|
|
34
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GrafanaTheme2 } from '@grafana/data';
|
|
2
|
+
export declare const getStyles: (theme: GrafanaTheme2) => {
|
|
3
|
+
container: string;
|
|
4
|
+
modal: string;
|
|
5
|
+
content: string;
|
|
6
|
+
backdrop: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const getBodyStyles: (theme: GrafanaTheme2) => {
|
|
9
|
+
title: string;
|
|
10
|
+
body: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Props as InputProps } from '@grafana/ui/components/Input/Input';
|
|
3
|
+
import './style.css';
|
|
4
|
+
export declare const formatDate: (date: Date) => string;
|
|
5
|
+
export interface DatePickerWithInputProps extends Omit<InputProps, 'ref' | 'value' | 'onChange'> {
|
|
6
|
+
value?: Date;
|
|
7
|
+
onChange: (value: Date) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const DatePickerWithInput: (props: DatePickerWithInputProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Props as InputProps } from '@grafana/ui/components/Input/Input';
|
|
3
|
+
export interface DebounceInputProps extends Omit<InputProps, 'ref'> {
|
|
4
|
+
value: string;
|
|
5
|
+
onDebounce: (debouncedInput?: string) => void;
|
|
6
|
+
delay?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const DebounceInput: (props: DebounceInputProps) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import { PluginErrorCode, PluginSignatureStatus } from '@grafana/data';
|
|
3
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
status?: PluginSignatureStatus;
|
|
5
|
+
}
|
|
6
|
+
export declare const PluginSignatureBadge: React.FC<Props>;
|
|
7
|
+
export declare function isUnsignedPluginSignature(signature?: PluginSignatureStatus): boolean | undefined;
|
|
8
|
+
export declare function mapPluginErrorCodeToSignatureStatus(code: PluginErrorCode): PluginSignatureStatus.invalid | PluginSignatureStatus.modified | PluginSignatureStatus.missing;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type ConfirmModalProps = {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onCancel?: () => void;
|
|
5
|
+
onDiscard?: () => void;
|
|
6
|
+
onCopy?: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function ConfirmModal({ isOpen, onCancel, onDiscard, onCopy }: ConfirmModalProps): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectableValue } from '@grafana/data';
|
|
3
|
+
import { DB, ResourceSelectorProps } from './types';
|
|
4
|
+
interface DatasetSelectorProps extends ResourceSelectorProps {
|
|
5
|
+
db: DB;
|
|
6
|
+
value: string | null;
|
|
7
|
+
applyDefault?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onChange: (v: SelectableValue) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const DatasetSelector: React.FC<DatasetSelectorProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ComponentProps } from 'react';
|
|
2
|
+
import { Field, PopoverContent } from '@grafana/ui';
|
|
3
|
+
interface EditorFieldProps extends ComponentProps<typeof Field> {
|
|
4
|
+
label: string;
|
|
5
|
+
children: React.ReactElement;
|
|
6
|
+
width?: number | string;
|
|
7
|
+
optional?: boolean;
|
|
8
|
+
tooltip?: PopoverContent;
|
|
9
|
+
}
|
|
10
|
+
export declare const EditorField: React.FC<EditorFieldProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface EditorListProps<T> {
|
|
3
|
+
items: Array<Partial<T>>;
|
|
4
|
+
renderItem: (item: Partial<T>, onChangeItem: (item: Partial<T>) => void, onDeleteItem: () => void) => React.ReactElement;
|
|
5
|
+
onChange: (items: Array<Partial<T>>) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function EditorList<T>({ items, renderItem, onChange }: EditorListProps<T>): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Props = {
|
|
3
|
+
fallBackComponent?: React.ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export declare class ErrorBoundary extends React.Component<Props, {
|
|
6
|
+
hasError: boolean;
|
|
7
|
+
}> {
|
|
8
|
+
constructor(props: Props);
|
|
9
|
+
static getDerivedStateFromError(): {
|
|
10
|
+
hasError: boolean;
|
|
11
|
+
};
|
|
12
|
+
render(): React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectCommonProps } from '@grafana/ui';
|
|
3
|
+
interface InlineSelectProps<T> extends SelectCommonProps<T> {
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function InlineSelect<T>({ label: labelProp, ...props }: InlineSelectProps<T>): JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { QueryEditorProps } from '@grafana/data';
|
|
3
|
+
import { SQLQuery, SQLOptions } from './types';
|
|
4
|
+
import { SqlDatasource } from '../../datasource/SqlDatasource';
|
|
5
|
+
declare type Props = QueryEditorProps<SqlDatasource, SQLQuery, SQLOptions>;
|
|
6
|
+
export declare function SqlQueryEditor({ datasource, query, onChange, onRunQuery, range }: Props): JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { QueryWithDefaults } from './defaults';
|
|
3
|
+
import { DB, SQLQuery, QueryRowFilter } from './types';
|
|
4
|
+
interface QueryHeaderProps {
|
|
5
|
+
db: DB;
|
|
6
|
+
query: QueryWithDefaults;
|
|
7
|
+
onChange: (query: SQLQuery) => void;
|
|
8
|
+
onRunQuery: () => void;
|
|
9
|
+
onQueryRowChange: (queryRowFilter: QueryRowFilter) => void;
|
|
10
|
+
queryRowFilter: QueryRowFilter;
|
|
11
|
+
isQueryRunnable: boolean;
|
|
12
|
+
labels?: Map<string, string>;
|
|
13
|
+
}
|
|
14
|
+
export declare function QueryHeader({ db, query, queryRowFilter, onChange, onRunQuery, onQueryRowChange, isQueryRunnable, labels, }: QueryHeaderProps): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface SpaceProps {
|
|
3
|
+
v?: number;
|
|
4
|
+
h?: number;
|
|
5
|
+
layout?: 'block' | 'inline';
|
|
6
|
+
}
|
|
7
|
+
export declare const Space: {
|
|
8
|
+
(props: SpaceProps): JSX.Element;
|
|
9
|
+
defaultProps: {
|
|
10
|
+
v: number;
|
|
11
|
+
h: number;
|
|
12
|
+
layout: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectableValue } from '@grafana/data';
|
|
3
|
+
import { DB, ResourceSelectorProps } from './types';
|
|
4
|
+
import { QueryWithDefaults } from './defaults';
|
|
5
|
+
interface TableSelectorProps extends ResourceSelectorProps {
|
|
6
|
+
db: DB;
|
|
7
|
+
value: string | null;
|
|
8
|
+
query: QueryWithDefaults;
|
|
9
|
+
onChange: (v: SelectableValue) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const TableSelector: React.FC<TableSelectorProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare enum QueryEditorPropertyType {
|
|
2
|
+
String = "string"
|
|
3
|
+
}
|
|
4
|
+
export interface QueryEditorProperty {
|
|
5
|
+
type: QueryEditorPropertyType;
|
|
6
|
+
name?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare type QueryEditorOperatorType = string | boolean | number;
|
|
9
|
+
declare type QueryEditorOperatorValueType = QueryEditorOperatorType | QueryEditorOperatorType[];
|
|
10
|
+
export interface QueryEditorOperator<T extends QueryEditorOperatorValueType> {
|
|
11
|
+
name?: string;
|
|
12
|
+
value?: T;
|
|
13
|
+
}
|
|
14
|
+
export interface QueryEditorOperatorExpression {
|
|
15
|
+
type: QueryEditorExpressionType.Operator;
|
|
16
|
+
property: QueryEditorProperty;
|
|
17
|
+
operator: QueryEditorOperator<QueryEditorOperatorValueType>;
|
|
18
|
+
}
|
|
19
|
+
export interface QueryEditorArrayExpression {
|
|
20
|
+
type: QueryEditorExpressionType.And | QueryEditorExpressionType.Or;
|
|
21
|
+
expressions: QueryEditorExpression[] | QueryEditorArrayExpression[];
|
|
22
|
+
}
|
|
23
|
+
export interface QueryEditorPropertyExpression {
|
|
24
|
+
type: QueryEditorExpressionType.Property;
|
|
25
|
+
property: QueryEditorProperty;
|
|
26
|
+
}
|
|
27
|
+
export declare enum QueryEditorExpressionType {
|
|
28
|
+
Property = "property",
|
|
29
|
+
Operator = "operator",
|
|
30
|
+
Or = "or",
|
|
31
|
+
And = "and",
|
|
32
|
+
GroupBy = "groupBy",
|
|
33
|
+
Function = "function",
|
|
34
|
+
FunctionParameter = "functionParameter"
|
|
35
|
+
}
|
|
36
|
+
export declare type QueryEditorExpression = QueryEditorArrayExpression | QueryEditorPropertyExpression | QueryEditorGroupByExpression | QueryEditorFunctionExpression | QueryEditorFunctionParameterExpression | QueryEditorOperatorExpression;
|
|
37
|
+
export interface QueryEditorGroupByExpression {
|
|
38
|
+
type: QueryEditorExpressionType.GroupBy;
|
|
39
|
+
property: QueryEditorProperty;
|
|
40
|
+
}
|
|
41
|
+
export interface QueryEditorFunctionExpression {
|
|
42
|
+
type: QueryEditorExpressionType.Function;
|
|
43
|
+
name?: string;
|
|
44
|
+
parameters?: QueryEditorFunctionParameterExpression[];
|
|
45
|
+
}
|
|
46
|
+
export interface QueryEditorFunctionParameterExpression {
|
|
47
|
+
type: QueryEditorExpressionType.FunctionParameter;
|
|
48
|
+
name?: string;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './visual-query-builder';
|
|
2
|
+
export { AccessoryButton } from './AccessoryButton';
|
|
3
|
+
export { EditorFieldGroup } from './EditorFieldGroup';
|
|
4
|
+
export { EditorHeader } from './EditorHeader';
|
|
5
|
+
export { EditorField } from './EditorField';
|
|
6
|
+
export { EditorRow } from './EditorRow';
|
|
7
|
+
export { EditorList } from './EditorList';
|
|
8
|
+
export { EditorRows } from './EditorRows';
|
|
9
|
+
export { EditorSwitch } from './EditorSwitch';
|
|
10
|
+
export { FlexItem } from './FlexItem';
|
|
11
|
+
export { Stack } from './Stack';
|
|
12
|
+
export { InlineSelect } from './InlineSelect';
|
|
13
|
+
export { InputGroup } from './InputGroup';
|
|
14
|
+
export { Space } from './Space';
|
|
15
|
+
export { SqlQueryEditor } from './QueryEditor';
|
|
16
|
+
export * from './types';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LanguageCompletionProvider } from '@grafana/experimental';
|
|
3
|
+
import { SQLQuery } from '../types';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
query: SQLQuery;
|
|
6
|
+
onChange: (value: SQLQuery, processQuery: boolean) => void;
|
|
7
|
+
children?: (props: {
|
|
8
|
+
formatQuery: () => void;
|
|
9
|
+
}) => React.ReactNode;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
completionProvider: LanguageCompletionProvider;
|
|
13
|
+
};
|
|
14
|
+
export declare function QueryEditorRaw({ children, onChange, query, width, height, completionProvider }: Props): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { QueryValidatorProps } from './QueryValidator';
|
|
3
|
+
interface QueryToolboxProps extends Omit<QueryValidatorProps, 'onValidate'> {
|
|
4
|
+
showTools?: boolean;
|
|
5
|
+
isExpanded?: boolean;
|
|
6
|
+
onFormatCode?: () => void;
|
|
7
|
+
onExpand?: (expand: boolean) => void;
|
|
8
|
+
onValidate?: (isValid: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function QueryToolbox({ showTools, onFormatCode, onExpand, isExpanded, ...validatorProps }: QueryToolboxProps): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TimeRange } from '@grafana/data';
|
|
3
|
+
import { DB, SQLQuery } from '../types';
|
|
4
|
+
export interface QueryValidatorProps {
|
|
5
|
+
db: DB;
|
|
6
|
+
query: SQLQuery;
|
|
7
|
+
range?: TimeRange;
|
|
8
|
+
onValidate: (isValid: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function QueryValidator({ db, query, onValidate, range }: QueryValidatorProps): JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { QueryEditorProps, SQLQuery } from '../types';
|
|
3
|
+
interface RawEditorProps extends Omit<QueryEditorProps, 'onChange'> {
|
|
4
|
+
onRunQuery: () => void;
|
|
5
|
+
onChange: (q: SQLQuery, processQuery: boolean) => void;
|
|
6
|
+
onValidate: (isValid: boolean) => void;
|
|
7
|
+
queryToValidate: SQLQuery;
|
|
8
|
+
}
|
|
9
|
+
export declare function RawEditor({ db, query, onChange, onRunQuery, onValidate, queryToValidate, range }: RawEditorProps): JSX.Element;
|
|
10
|
+
export {};
|