@grafana/plugin-ui 0.7.2 → 0.8.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.
Files changed (75) hide show
  1. package/README.md +0 -22
  2. package/dist/components/AsyncButtonCascader/AsyncButtonCascader.js +3 -3
  3. package/dist/components/AsyncButtonCascader/AsyncButtonCascader.js.map +1 -1
  4. package/dist/components/ConfigEditor/InlineLabel.js.map +1 -1
  5. package/dist/components/ConfigEditor/SecureSocksProxyToggle.js +9 -10
  6. package/dist/components/ConfigEditor/SecureSocksProxyToggle.js.map +1 -1
  7. package/dist/components/CustomHeadersSettings/CustomHeadersSettings.js +12 -17
  8. package/dist/components/CustomHeadersSettings/CustomHeadersSettings.js.map +1 -1
  9. package/dist/components/Plugins/PluginSignatureBadge.js.map +1 -1
  10. package/dist/components/QueryEditor/AccessoryButton.js.map +1 -1
  11. package/dist/components/QueryEditor/DatasetSelector.js.map +1 -1
  12. package/dist/components/QueryEditor/EditorField.js.map +1 -1
  13. package/dist/components/QueryEditor/EditorFieldGroup.js.map +1 -1
  14. package/dist/components/QueryEditor/EditorHeader.js.map +1 -1
  15. package/dist/components/QueryEditor/EditorRow.js.map +1 -1
  16. package/dist/components/QueryEditor/EditorRows.js.map +1 -1
  17. package/dist/components/QueryEditor/EditorSwitch.js.map +1 -1
  18. package/dist/components/QueryEditor/FlexItem.js.map +1 -1
  19. package/dist/components/QueryEditor/InputGroup.js.map +1 -1
  20. package/dist/components/QueryEditor/RunQueryButton.js +3 -5
  21. package/dist/components/QueryEditor/RunQueryButton.js.map +1 -1
  22. package/dist/components/QueryEditor/Stack.js.map +1 -1
  23. package/dist/components/QueryEditor/TableSelector.js.map +1 -1
  24. package/dist/components/QueryEditor/types.js +2 -2
  25. package/dist/components/QueryEditor/types.js.map +1 -1
  26. package/dist/components/QueryEditor/visual-query-builder/AwesomeQueryBuilder.js +1 -1
  27. package/dist/components/QueryEditor/visual-query-builder/AwesomeQueryBuilder.js.map +1 -1
  28. package/dist/components/QueryEditor/visual-query-builder/EditorField.js.map +1 -1
  29. package/dist/components/QueryEditor/visual-query-builder/EditorRow.js.map +1 -1
  30. package/dist/components/QueryEditor/visual-query-builder/EditorRows.js.map +1 -1
  31. package/dist/components/QueryEditor/visual-query-builder/Stack.js.map +1 -1
  32. package/dist/components/QueryEditor/visual-query-builder/VisualEditor.js +1 -1
  33. package/dist/components/QueryEditor/visual-query-builder/VisualEditor.js.map +1 -1
  34. package/dist/datasource/SqlDatasource.js.map +1 -1
  35. package/dist/index.js +0 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/src/components/AsyncButtonCascader/AsyncButtonCascader.d.ts +5 -2
  38. package/dist/src/components/ConfigEditor/InlineLabel.d.ts +3 -3
  39. package/dist/src/components/ConfigEditor/SecureSocksProxyToggle.d.ts +4 -4
  40. package/dist/src/components/CustomHeadersSettings/CustomHeadersSettings.d.ts +2 -2
  41. package/dist/src/components/Plugins/PluginSignatureBadge.d.ts +5 -2
  42. package/dist/src/components/QueryEditor/AccessoryButton.d.ts +2 -2
  43. package/dist/src/components/QueryEditor/DatasetSelector.d.ts +2 -2
  44. package/dist/src/components/QueryEditor/EditorField.d.ts +1 -1
  45. package/dist/src/components/QueryEditor/EditorFieldGroup.d.ts +2 -1
  46. package/dist/src/components/QueryEditor/EditorHeader.d.ts +2 -1
  47. package/dist/src/components/QueryEditor/EditorRow.d.ts +2 -1
  48. package/dist/src/components/QueryEditor/EditorRows.d.ts +2 -1
  49. package/dist/src/components/QueryEditor/EditorSwitch.d.ts +2 -2
  50. package/dist/src/components/QueryEditor/FlexItem.d.ts +2 -2
  51. package/dist/src/components/QueryEditor/InputGroup.d.ts +2 -1
  52. package/dist/src/components/QueryEditor/RunQueryButton.d.ts +3 -3
  53. package/dist/src/components/QueryEditor/Stack.d.ts +2 -1
  54. package/dist/src/components/QueryEditor/TableSelector.d.ts +2 -2
  55. package/dist/src/components/QueryEditor/types.d.ts +9 -9
  56. package/dist/src/components/QueryEditor/visual-query-builder/EditorField.d.ts +1 -1
  57. package/dist/src/components/QueryEditor/visual-query-builder/EditorRow.d.ts +2 -1
  58. package/dist/src/components/QueryEditor/visual-query-builder/EditorRows.d.ts +2 -1
  59. package/dist/src/components/QueryEditor/visual-query-builder/Stack.d.ts +2 -1
  60. package/dist/src/components/QueryEditor/visual-query-builder/VisualEditor.d.ts +2 -2
  61. package/dist/src/datasource/SqlDatasource.d.ts +3 -3
  62. package/dist/src/index.d.ts +0 -1
  63. package/dist/test/mocks/QueryEditorProps.js +0 -1
  64. package/dist/test/mocks/QueryEditorProps.js.map +1 -1
  65. package/package.json +21 -10
  66. package/CHANGELOG.md +0 -25
  67. package/dist/src/unreleasedComponents/SecretInput.d.ts +0 -15
  68. package/dist/src/unreleasedComponents/SecretTextarea.d.ts +0 -19
  69. package/dist/src/unreleasedComponents/index.d.ts +0 -2
  70. package/dist/unreleasedComponents/SecretInput.js +0 -21
  71. package/dist/unreleasedComponents/SecretInput.js.map +0 -1
  72. package/dist/unreleasedComponents/SecretTextarea.js +0 -36
  73. package/dist/unreleasedComponents/SecretTextarea.js.map +0 -1
  74. package/dist/unreleasedComponents/index.js +0 -9
  75. package/dist/unreleasedComponents/index.js.map +0 -1
@@ -1,9 +1,12 @@
1
- import React, { HTMLAttributes } from 'react';
1
+ import { HTMLAttributes } from 'react';
2
2
  import { PluginErrorCode, PluginSignatureStatus } from '@grafana/data';
3
3
  interface Props extends HTMLAttributes<HTMLDivElement> {
4
4
  status?: PluginSignatureStatus;
5
5
  }
6
- export declare const PluginSignatureBadge: React.FC<Props>;
6
+ export declare const PluginSignatureBadge: {
7
+ ({ status, ...otherProps }: Props): JSX.Element;
8
+ displayName: string;
9
+ };
7
10
  export declare function isUnsignedPluginSignature(signature?: PluginSignatureStatus): boolean | undefined;
8
11
  export declare function mapPluginErrorCodeToSignatureStatus(code: PluginErrorCode): PluginSignatureStatus.invalid | PluginSignatureStatus.modified | PluginSignatureStatus.missing;
9
12
  export {};
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { ButtonProps } from '@grafana/ui';
3
3
  interface AccessoryButtonProps extends ButtonProps {
4
4
  }
5
- export declare const AccessoryButton: React.FC<AccessoryButtonProps>;
5
+ export declare const AccessoryButton: ({ className, ...props }: AccessoryButtonProps) => JSX.Element;
6
6
  export {};
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { SelectableValue } from '@grafana/data';
3
3
  import { DB, ResourceSelectorProps } from './types';
4
4
  interface DatasetSelectorProps extends ResourceSelectorProps {
@@ -9,5 +9,5 @@ interface DatasetSelectorProps extends ResourceSelectorProps {
9
9
  disabled?: boolean;
10
10
  onChange: (v: SelectableValue) => void;
11
11
  }
12
- export declare const DatasetSelector: React.FC<DatasetSelectorProps>;
12
+ export declare const DatasetSelector: ({ db, dataset, value, onChange, disabled, className, applyDefault, }: DatasetSelectorProps) => JSX.Element;
13
13
  export {};
@@ -7,5 +7,5 @@ interface EditorFieldProps extends ComponentProps<typeof Field> {
7
7
  optional?: boolean;
8
8
  tooltip?: PopoverContent;
9
9
  }
10
- export declare const EditorField: React.FC<EditorFieldProps>;
10
+ export declare const EditorField: (props: EditorFieldProps) => JSX.Element;
11
11
  export {};
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface EditorFieldGroupProps {
3
+ children?: React.ReactNode;
3
4
  }
4
- export declare const EditorFieldGroup: React.FC<EditorFieldGroupProps>;
5
+ export declare const EditorFieldGroup: ({ children }: EditorFieldGroupProps) => JSX.Element;
5
6
  export {};
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface EditorHeaderProps {
3
+ children?: React.ReactNode;
3
4
  }
4
- export declare const EditorHeader: React.FC<EditorHeaderProps>;
5
+ export declare const EditorHeader: ({ children }: EditorHeaderProps) => JSX.Element;
5
6
  export {};
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface EditorRowProps {
3
+ children?: React.ReactNode;
3
4
  }
4
- export declare const EditorRow: React.FC<EditorRowProps>;
5
+ export declare const EditorRow: ({ children }: EditorRowProps) => JSX.Element;
5
6
  export {};
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface EditorRowsProps {
3
+ children?: React.ReactNode;
3
4
  }
4
- export declare const EditorRows: React.FC<EditorRowsProps>;
5
+ export declare const EditorRows: ({ children }: EditorRowsProps) => JSX.Element;
5
6
  export {};
@@ -1,3 +1,3 @@
1
1
  import { Switch } from '@grafana/ui';
2
- import React, { ComponentProps } from 'react';
3
- export declare const EditorSwitch: React.FC<ComponentProps<typeof Switch>>;
2
+ import { ComponentProps } from 'react';
3
+ export declare const EditorSwitch: (props: ComponentProps<typeof Switch>) => JSX.Element;
@@ -1,7 +1,7 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  interface FlexItemProps {
3
3
  grow?: number;
4
4
  shrink?: number;
5
5
  }
6
- export declare const FlexItem: React.FC<FlexItemProps>;
6
+ export declare const FlexItem: ({ grow, shrink }: FlexItemProps) => JSX.Element;
7
7
  export {};
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface InputGroupProps {
3
+ children?: React.ReactNode;
3
4
  }
4
- export declare const InputGroup: React.FC<InputGroupProps>;
5
+ export declare const InputGroup: ({ children }: InputGroupProps) => JSX.Element;
5
6
  export {};
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { PopoverContent } from "@grafana/ui";
1
+ /// <reference types="react" />
2
+ import { PopoverContent } from '@grafana/ui';
3
3
  type RunQueryButtonProps = {
4
4
  ariaLabel?: string;
5
5
  queryInvalid?: boolean;
@@ -9,5 +9,5 @@ type RunQueryButtonProps = {
9
9
  onClick: () => void;
10
10
  dataTestId?: string;
11
11
  };
12
- export declare const RunQueryButton: React.FC<RunQueryButtonProps>;
12
+ export declare const RunQueryButton: ({ ariaLabel, queryRunning, queryInvalid, invalidQueryTooltip, disabled, onClick, dataTestId, }: RunQueryButtonProps) => JSX.Element;
13
13
  export {};
@@ -1,9 +1,10 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  interface StackProps {
3
+ children?: React.ReactNode;
3
4
  direction?: CSSProperties['flexDirection'];
4
5
  alignItems?: CSSProperties['alignItems'];
5
6
  wrap?: boolean;
6
7
  gap?: number;
7
8
  }
8
- export declare const Stack: React.FC<StackProps>;
9
+ export declare const Stack: ({ children, ...props }: StackProps) => JSX.Element;
9
10
  export {};
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { SelectableValue } from '@grafana/data';
3
3
  import { DB, ResourceSelectorProps } from './types';
4
4
  import { QueryWithDefaults } from './defaults';
@@ -9,5 +9,5 @@ interface TableSelectorProps extends ResourceSelectorProps {
9
9
  query: QueryWithDefaults;
10
10
  onChange: (v: SelectableValue) => void;
11
11
  }
12
- export declare const TableSelector: React.FC<TableSelectorProps>;
12
+ export declare const TableSelector: ({ db, dataset, value, className, onChange }: TableSelectorProps) => JSX.Element;
13
13
  export {};
@@ -1,9 +1,9 @@
1
- import { JsonTree } from "react-awesome-query-builder";
2
- import { DataFrame, DataSourceJsonData, MetricFindValue, SelectableValue, TimeRange } from "@grafana/data";
3
- import { DataQuery } from "@grafana/schema";
4
- import { QueryWithDefaults } from "./defaults";
5
- import { QueryEditorFunctionExpression, QueryEditorGroupByExpression, QueryEditorPropertyExpression } from "./expressions";
6
- import { CompletionItemKind, LanguageCompletionProvider } from "@grafana/experimental";
1
+ import { JsonTree } from 'react-awesome-query-builder';
2
+ import { DataFrame, DataSourceJsonData, MetricFindValue, SelectableValue, TimeRange } from '@grafana/data';
3
+ import { DataQuery } from '@grafana/schema';
4
+ import { QueryWithDefaults } from './defaults';
5
+ import { QueryEditorFunctionExpression, QueryEditorGroupByExpression, QueryEditorPropertyExpression } from './expressions';
6
+ import { CompletionItemKind, LanguageCompletionProvider } from '@grafana/experimental';
7
7
  export interface SqlQueryForInterpolation {
8
8
  dataset?: string;
9
9
  alias?: string;
@@ -60,7 +60,7 @@ export interface SQLExpression {
60
60
  filters?: SQLFilters;
61
61
  groupBy?: QueryEditorGroupByExpression[];
62
62
  orderBy?: QueryEditorPropertyExpression;
63
- orderByDirection?: "ASC" | "DESC";
63
+ orderByDirection?: 'ASC' | 'DESC';
64
64
  limit?: number;
65
65
  offset?: number;
66
66
  }
@@ -91,7 +91,7 @@ export interface ResourceSelectorProps {
91
91
  className?: string;
92
92
  applyDefault?: boolean;
93
93
  }
94
- export type RAQBFieldTypes = "text" | "number" | "boolean" | "datetime" | "date" | "time";
94
+ export type RAQBFieldTypes = 'text' | 'number' | 'boolean' | 'datetime' | 'date' | 'time';
95
95
  export interface SQLSelectableValue extends SelectableValue {
96
96
  type?: string;
97
97
  raqbFieldType?: RAQBFieldTypes;
@@ -116,7 +116,7 @@ export interface DB {
116
116
  getSqlCompletionProvider: () => LanguageCompletionProvider;
117
117
  toRawSql?: (query: SQLQuery) => string;
118
118
  functions: () => Promise<Aggregate[]>;
119
- labels?: Map<"dataset", string>;
119
+ labels?: Map<'dataset', string>;
120
120
  disableDatasets?: boolean;
121
121
  }
122
122
  export interface QueryEditorProps {
@@ -7,5 +7,5 @@ interface EditorFieldProps extends ComponentProps<typeof Field> {
7
7
  optional?: boolean;
8
8
  tooltip?: PopoverContent;
9
9
  }
10
- export declare const EditorField: React.FC<EditorFieldProps>;
10
+ export declare const EditorField: (props: EditorFieldProps) => JSX.Element;
11
11
  export {};
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface EditorRowProps {
3
+ children?: React.ReactNode;
3
4
  }
4
- export declare const EditorRow: React.FC<EditorRowProps>;
5
+ export declare const EditorRow: ({ children }: EditorRowProps) => JSX.Element;
5
6
  export {};
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface EditorRowsProps {
3
+ children?: React.ReactNode;
3
4
  }
4
- export declare const EditorRows: React.FC<EditorRowsProps>;
5
+ export declare const EditorRows: ({ children }: EditorRowsProps) => JSX.Element;
5
6
  export {};
@@ -4,6 +4,7 @@ interface StackProps {
4
4
  alignItems?: CSSProperties['alignItems'];
5
5
  wrap?: boolean;
6
6
  gap?: number;
7
+ children?: React.ReactNode;
7
8
  }
8
- export declare const Stack: React.FC<StackProps>;
9
+ export declare const Stack: ({ children, ...props }: StackProps) => JSX.Element;
9
10
  export {};
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { DB, QueryEditorProps, QueryRowFilter } from '../types';
3
3
  import { SQLQuery } from '../types';
4
4
  import { TimeRange } from '@grafana/data';
@@ -10,5 +10,5 @@ interface VisualEditorProps extends QueryEditorProps {
10
10
  onValidate: (isValid: boolean) => void;
11
11
  range?: TimeRange;
12
12
  }
13
- export declare const VisualEditor: React.FC<VisualEditorProps>;
13
+ export declare const VisualEditor: ({ query, db, queryRowFilter, onChange, onValidate, range }: VisualEditorProps) => JSX.Element;
14
14
  export {};
@@ -1,4 +1,4 @@
1
- import { DataFrameView, DataSourceInstanceSettings, DataSourceRef, MetricFindValue, ScopedVars, TimeRange, VariableModel } from '@grafana/data';
1
+ import { DataFrameView, DataSourceInstanceSettings, MetricFindValue, ScopedVars, TimeRange, VariableModel } from '@grafana/data';
2
2
  import { DataSourceWithBackend, TemplateSrv } from '@grafana/runtime';
3
3
  import { SQLQuery, SQLOptions, DB, SqlQueryModel, ResponseParser } from '../components/QueryEditor/types';
4
4
  export interface SearchFilterOptions {
@@ -35,10 +35,10 @@ export declare abstract class SqlDatasource extends DataSourceWithBackend<SQLQue
35
35
  interpolateVariable: (value: string | string[] | number, variable: VariableWithMultiSupport) => string | number;
36
36
  interpolateVariablesInQueries(queries: SQLQuery[], scopedVars: ScopedVars): SQLQuery[];
37
37
  filterQuery(query: SQLQuery): boolean;
38
- applyTemplateVariables(target: SQLQuery, scopedVars: ScopedVars): Record<string, string | DataSourceRef | SQLQuery['format']>;
38
+ applyTemplateVariables(target: SQLQuery, scopedVars: ScopedVars): SQLQuery;
39
39
  clean(value: string): string;
40
40
  metricFindQuery(query: string, optionalOptions?: MetricFindQueryOptions): Promise<MetricFindValue[]>;
41
- runSql<T>(query: string, options?: RunSQLOptions): Promise<DataFrameView<T>>;
41
+ runSql<T extends object>(query: string, options?: RunSQLOptions): Promise<DataFrameView<T>>;
42
42
  private runMetaQuery;
43
43
  testDatasource(): Promise<{
44
44
  status: string;
@@ -4,7 +4,6 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
  export * from './components';
7
- export * from './unreleasedComponents';
8
7
  export * from './test/mocks';
9
8
  export * from './utils';
10
9
  export { SqlDatasource } from './datasource/SqlDatasource';
@@ -23,7 +23,6 @@ const mockQueryEditorProps = () => ({
23
23
  timeRange: (0, exports.mockTimeRange)(),
24
24
  },
25
25
  range: (0, exports.mockTimeRange)(),
26
- exploreId: (0, chance_1.Chance)().guid(),
27
26
  history: [],
28
27
  });
29
28
  exports.mockQueryEditorProps = mockQueryEditorProps;
@@ -1 +1 @@
1
- {"version":3,"file":"QueryEditorProps.js","sourceRoot":"","sources":["../../../src/test/mocks/QueryEditorProps.ts"],"names":[],"mappings":";;;AAAA,wCAMuB;AACvB,mCAAgC;AAEzB,MAAM,oBAAoB,GAAG,GAAoC,EAAE,CAAC,CAAC;IAC1E,UAAU,EAAE,EAAE;IACd,KAAK,EAAE;QACL,KAAK,EAAE,IAAA,eAAM,GAAE,CAAC,IAAI,EAAE;QACtB,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,IAAA,eAAM,GAAE,CAAC,IAAI,EAAE;QACpB,SAAS,EAAE,IAAA,eAAM,GAAE,CAAC,IAAI,EAAE;QAC1B,SAAS,EAAE,gBAAS,CAAC,WAAW;QAChC,UAAU,EAAE,IAAA,eAAM,GAAE,CAAC,OAAO,CAAC,CAAC,IAAA,eAAM,GAAE,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;KACtD;IACD,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;IACrB,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE;IAC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ugin-ui.git",
5
5
  "author": "Grafana Labs",
6
6
  "main": "dist/index.js",
@@ -19,12 +19,7 @@
19
19
  "dependencies": {
20
20
  "@changesets/read": "^0.5.9",
21
21
  "@changesets/write": "^0.2.3",
22
- "@grafana/data": "^9.5.13",
23
- "@grafana/e2e-selectors": "^9.5.13",
24
22
  "@grafana/experimental": "1.7.4",
25
- "@grafana/runtime": "^9.5.13",
26
- "@grafana/tsconfig": "1.2.0-rc1",
27
- "@grafana/ui": "^9.5.13",
28
23
  "chance": "^1.1.7",
29
24
  "fast-glob": "^3.3.1",
30
25
  "lodash": "^4.17.21",
@@ -35,7 +30,6 @@
35
30
  "react-use": "17.3.1",
36
31
  "react-virtualized-auto-sizer": "^1.0.6",
37
32
  "semver": "^7.5.4",
38
- "@testing-library/user-event": "^12.8.3",
39
33
  "sql-formatter-plus": "^1.3.6"
40
34
  },
41
35
  "devDependencies": {
@@ -47,14 +41,20 @@
47
41
  "@babel/preset-typescript": "^7.12.7",
48
42
  "@changesets/cli": "^2.26.2",
49
43
  "@changesets/types": "^5.2.1",
44
+ "@grafana/data": "^10.4.0",
45
+ "@grafana/e2e-selectors": "^10.4.0",
46
+ "@grafana/runtime": "^10.4.0",
47
+ "@grafana/tsconfig": "1.3.0-rc1",
48
+ "@grafana/ui": "^10.4.0",
50
49
  "@storybook/addon-actions": "^6.5.16",
51
50
  "@storybook/addon-essentials": "^6.5.16",
52
51
  "@storybook/addon-links": "^6.5.16",
53
52
  "@storybook/addons": "^6.5.16",
54
53
  "@storybook/react": "^6.5.16",
55
54
  "@storybook/theming": "^6.5.16",
56
- "@testing-library/jest-dom": "^5.11.6",
57
- "@testing-library/react": "^11.2.2",
55
+ "@testing-library/jest-dom": "5.16.5",
56
+ "@testing-library/react": "15.0.2",
57
+ "@testing-library/user-event": "14.5.2",
58
58
  "@types/chance": "^1.1.0",
59
59
  "@types/lodash": "^4.14.194",
60
60
  "@types/memoize-one": "^5.1.2",
@@ -67,12 +67,23 @@
67
67
  "copyfiles": "^2.4.1",
68
68
  "jest-fetch-mock": "^3.0.3",
69
69
  "mockdate": "^3.0.2",
70
+ "react": "18.2.0",
71
+ "react-dom": "18.2.0",
72
+ "rxjs": "^7.8.1",
70
73
  "ts-jest": "^26.4.4",
71
74
  "ts-node": "^10.9.1",
72
75
  "typescript": "^4.9.5"
73
76
  },
74
77
  "peerDependencies": {
75
- "@changesets/cli": ">=2.x"
78
+ "@changesets/cli": ">=2.x",
79
+ "@grafana/data": "^10.4.0",
80
+ "@grafana/e2e-selectors": "^10.4.0",
81
+ "@grafana/runtime": "^10.4.0",
82
+ "@grafana/tsconfig": "1.3.0-rc1",
83
+ "@grafana/ui": "^10.4.0",
84
+ "react": "18.2.0",
85
+ "react-dom": "18.2.0",
86
+ "rxjs": "^7.8.1"
76
87
  },
77
88
  "files": [
78
89
  "dist/**/*",
package/CHANGELOG.md DELETED
@@ -1,25 +0,0 @@
1
- # Change Log
2
-
3
- ## v0.7.0 - 2024-04-30
4
-
5
- - ⚙️ **Chore**: changing the QueryFormat enum to match grafana's sqlds and sqlutil constant values
6
-
7
- ## v0.6.3 - 2024-04-15
8
-
9
- - ⚙️ **Chore**: allow datasets to be disabled in the sql query editor
10
-
11
- ## v0.6.2 - 2024-02-02
12
-
13
- - ⚙️ **Chore**: better type checks for DB.labels
14
-
15
- ## v0.6.1 - 2024-01-09
16
-
17
- - 🐛 **Fix**: moving user_event library from dev-dependencies to dependencies
18
-
19
- ## v0.6.0 - 2023-10-25
20
-
21
- - ⚙️ **Chore**: **BREAKING**: Remove e2e related functionality
22
-
23
- ## v0.5.0 - 2023-10-24
24
-
25
- - ⚙️ **Chore**: Update `@grafana` dependencies from v8 to latest v9
@@ -1,15 +0,0 @@
1
- /**
2
- * Copy & paste from https://github.com/grafana/grafana/blob/main/packages/grafana-ui/src/components/SecretInput/SecretInput.tsx
3
- * Available starting from @grafana/ui 9.2
4
- */
5
- import * as React from "react";
6
- import { Input } from "@grafana/ui";
7
- export type Props = React.ComponentProps<typeof Input> & {
8
- /** TRUE if the secret was already configured. (It is needed as often the backend doesn't send back the actual secret, only the information that it was configured) */
9
- isConfigured: boolean;
10
- /** Called when the user clicks on the "Reset" button in order to clear the secret */
11
- onReset: () => void;
12
- };
13
- export declare const CONFIGURED_TEXT = "configured";
14
- export declare const RESET_BUTTON_TEXT = "Reset";
15
- export declare const SecretInput: ({ isConfigured, onReset, ...props }: Props) => JSX.Element;
@@ -1,19 +0,0 @@
1
- /**
2
- * Copy & paste from https://github.com/grafana/grafana/blob/main/packages/grafana-ui/src/components/SecretTextArea/SecretTextArea.tsx
3
- * Available starting from @grafana/ui 9.2
4
- */
5
- import * as React from "react";
6
- import { TextArea } from "@grafana/ui";
7
- export type Props = React.ComponentProps<typeof TextArea> & {
8
- /** TRUE if the secret was already configured. (It is needed as often the backend doesn't send back the actual secret, only the information that it was configured) */
9
- isConfigured: boolean;
10
- /** Called when the user clicks on the "Reset" button in order to clear the secret */
11
- onReset: () => void;
12
- };
13
- export declare const CONFIGURED_TEXT = "configured";
14
- export declare const RESET_BUTTON_TEXT = "Reset";
15
- /**
16
- * Text area that does not disclose an already configured value but lets the user reset the current value and enter a new one.
17
- * Typically useful for asymmetric cryptography keys.
18
- */
19
- export declare const SecretTextArea: ({ isConfigured, onReset, ...props }: Props) => JSX.Element;
@@ -1,2 +0,0 @@
1
- export { SecretInput } from "./SecretInput";
2
- export { SecretTextArea } from "./SecretTextarea";
@@ -1,21 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copy & paste from https://github.com/grafana/grafana/blob/main/packages/grafana-ui/src/components/SecretInput/SecretInput.tsx
4
- * Available starting from @grafana/ui 9.2
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SecretInput = exports.RESET_BUTTON_TEXT = exports.CONFIGURED_TEXT = void 0;
8
- const tslib_1 = require("tslib");
9
- const React = tslib_1.__importStar(require("react"));
10
- const ui_1 = require("@grafana/ui");
11
- exports.CONFIGURED_TEXT = "configured";
12
- exports.RESET_BUTTON_TEXT = "Reset";
13
- const SecretInput = (_a) => {
14
- var { isConfigured, onReset } = _a, props = tslib_1.__rest(_a, ["isConfigured", "onReset"]);
15
- return (React.createElement(ui_1.HorizontalGroup, null,
16
- !isConfigured && React.createElement(ui_1.Input, Object.assign({}, props, { type: "password" })),
17
- isConfigured && (React.createElement(ui_1.Input, Object.assign({}, props, { type: "text", disabled: true, value: exports.CONFIGURED_TEXT }))),
18
- isConfigured && (React.createElement(ui_1.Button, { onClick: onReset, variant: "secondary" }, exports.RESET_BUTTON_TEXT))));
19
- };
20
- exports.SecretInput = SecretInput;
21
- //# sourceMappingURL=SecretInput.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SecretInput.js","sourceRoot":"","sources":["../../src/unreleasedComponents/SecretInput.tsx"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,qDAA+B;AAC/B,oCAA6D;AAShD,QAAA,eAAe,GAAG,YAAY,CAAC;AAC/B,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAElC,MAAM,WAAW,GAAG,CAAC,EAA0C,EAAE,EAAE;QAA9C,EAAE,YAAY,EAAE,OAAO,OAAmB,EAAd,KAAK,sBAAjC,2BAAmC,CAAF;IAAc,OAAA,CACzE,oBAAC,oBAAe;QACb,CAAC,YAAY,IAAI,oBAAC,UAAK,oBAAK,KAAK,IAAE,IAAI,EAAC,UAAU,IAAG;QACrD,YAAY,IAAI,CACf,oBAAC,UAAK,oBAAK,KAAK,IAAE,IAAI,EAAC,MAAM,EAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,uBAAe,IAAI,CACzE;QACA,YAAY,IAAI,CACf,oBAAC,WAAM,IAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAC,WAAW,IAC1C,yBAAiB,CACX,CACV,CACe,CACnB,CAAA;CAAA,CAAC;AAZW,QAAA,WAAW,eAYtB"}
@@ -1,36 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copy & paste from https://github.com/grafana/grafana/blob/main/packages/grafana-ui/src/components/SecretTextArea/SecretTextArea.tsx
4
- * Available starting from @grafana/ui 9.2
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SecretTextArea = exports.RESET_BUTTON_TEXT = exports.CONFIGURED_TEXT = void 0;
8
- const tslib_1 = require("tslib");
9
- const css_1 = require("@emotion/css");
10
- const React = tslib_1.__importStar(require("react"));
11
- const ui_1 = require("@grafana/ui");
12
- exports.CONFIGURED_TEXT = "configured";
13
- exports.RESET_BUTTON_TEXT = "Reset";
14
- const getStyles = (theme) => {
15
- return {
16
- configuredStyle: (0, css_1.css) `
17
- min-height: ${theme.spacing(theme.components.height.md)};
18
- padding-top: ${theme.spacing(0.5) /** Needed to mimic vertically centered text in an input box */};
19
- resize: none;
20
- `,
21
- };
22
- };
23
- /**
24
- * Text area that does not disclose an already configured value but lets the user reset the current value and enter a new one.
25
- * Typically useful for asymmetric cryptography keys.
26
- */
27
- const SecretTextArea = (_a) => {
28
- var { isConfigured, onReset } = _a, props = tslib_1.__rest(_a, ["isConfigured", "onReset"]);
29
- const styles = (0, ui_1.useStyles2)(getStyles);
30
- return (React.createElement(ui_1.HorizontalGroup, null,
31
- !isConfigured && React.createElement(ui_1.TextArea, Object.assign({}, props)),
32
- isConfigured && (React.createElement(ui_1.TextArea, Object.assign({}, props, { rows: 1, disabled: true, value: exports.CONFIGURED_TEXT, className: (0, css_1.cx)(styles.configuredStyle) }))),
33
- isConfigured && (React.createElement(ui_1.Button, { onClick: onReset, variant: "secondary" }, exports.RESET_BUTTON_TEXT))));
34
- };
35
- exports.SecretTextArea = SecretTextArea;
36
- //# sourceMappingURL=SecretTextarea.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SecretTextarea.js","sourceRoot":"","sources":["../../src/unreleasedComponents/SecretTextarea.tsx"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,sCAAuC;AACvC,qDAA+B;AAG/B,oCAA4E;AAS/D,QAAA,eAAe,GAAG,YAAY,CAAC;AAC/B,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAEzC,MAAM,SAAS,GAAG,CAAC,KAAoB,EAAE,EAAE;IACzC,OAAO;QACL,eAAe,EAAE,IAAA,SAAG,EAAA;oBACJ,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;qBAErD,KAAK,CAAC,OAAO,CACX,GAAG,CACJ,CAAC,+DACJ;;KAED;KACF,CAAC;AACJ,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,cAAc,GAAG,CAAC,EAA0C,EAAE,EAAE;QAA9C,EAAE,YAAY,EAAE,OAAO,OAAmB,EAAd,KAAK,sBAAjC,2BAAmC,CAAF;IAC9D,MAAM,MAAM,GAAG,IAAA,eAAU,EAAC,SAAS,CAAC,CAAC;IACrC,OAAO,CACL,oBAAC,oBAAe;QACb,CAAC,YAAY,IAAI,oBAAC,aAAQ,oBAAK,KAAK,EAAI;QACxC,YAAY,IAAI,CACf,oBAAC,aAAQ,oBACH,KAAK,IACT,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,IAAI,EACd,KAAK,EAAE,uBAAe,EACtB,SAAS,EAAE,IAAA,QAAE,EAAC,MAAM,CAAC,eAAe,CAAC,IACrC,CACH;QACA,YAAY,IAAI,CACf,oBAAC,WAAM,IAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAC,WAAW,IAC1C,yBAAiB,CACX,CACV,CACe,CACnB,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,cAAc,kBAqBzB"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SecretTextArea = exports.SecretInput = void 0;
4
- // noop for when there are no components here
5
- var SecretInput_1 = require("./SecretInput");
6
- Object.defineProperty(exports, "SecretInput", { enumerable: true, get: function () { return SecretInput_1.SecretInput; } });
7
- var SecretTextarea_1 = require("./SecretTextarea");
8
- Object.defineProperty(exports, "SecretTextArea", { enumerable: true, get: function () { return SecretTextarea_1.SecretTextArea; } });
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unreleasedComponents/index.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAC7C,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA"}