@grafana/plugin-ui 0.1.15 → 0.1.17
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/components/ConfigEditor/DataSourceDescription.js +42 -0
- package/dist/components/ConfigEditor/DataSourceDescription.js.map +1 -0
- package/dist/components/ConfigEditor/InlineLabel.js +24 -0
- package/dist/components/ConfigEditor/InlineLabel.js.map +1 -0
- package/dist/components/ConfigEditor/index.js +8 -0
- package/dist/components/ConfigEditor/index.js.map +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/src/components/ConfigEditor/DataSourceDescription.d.ts +8 -0
- package/dist/src/components/ConfigEditor/InlineLabel.d.ts +7 -0
- package/dist/src/components/ConfigEditor/index.d.ts +2 -0
- package/dist/src/components/index.d.ts +1 -0
- package/package.json +4 -2
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataSourceDescription = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const css_1 = require("@emotion/css");
|
|
7
|
+
const ui_1 = require("@grafana/ui");
|
|
8
|
+
const DataSourceDescription = ({ dataSourceName, docsLink, hasRequiredFields = true, }) => {
|
|
9
|
+
const theme = (0, ui_1.useTheme2)();
|
|
10
|
+
const styles = {
|
|
11
|
+
container: (0, css_1.css)({
|
|
12
|
+
margin: theme.spacing(4, 0),
|
|
13
|
+
}),
|
|
14
|
+
text: (0, css_1.css)(Object.assign(Object.assign({}, theme.typography.body), { color: theme.colors.text.secondary, a: (0, css_1.css)({
|
|
15
|
+
color: theme.colors.text.link,
|
|
16
|
+
textDecoration: "underline",
|
|
17
|
+
"&:hover": {
|
|
18
|
+
textDecoration: "none",
|
|
19
|
+
},
|
|
20
|
+
}) })),
|
|
21
|
+
asterisk: (0, css_1.css) `
|
|
22
|
+
color: ${theme.colors.error.main};
|
|
23
|
+
`,
|
|
24
|
+
};
|
|
25
|
+
return (react_1.default.createElement("div", { className: styles.container },
|
|
26
|
+
react_1.default.createElement("p", { className: styles.text },
|
|
27
|
+
"Before you can use the ",
|
|
28
|
+
dataSourceName,
|
|
29
|
+
" data source, you must configure it below or in the config file.",
|
|
30
|
+
react_1.default.createElement("br", null),
|
|
31
|
+
"For detailed instructions,",
|
|
32
|
+
" ",
|
|
33
|
+
react_1.default.createElement("a", { href: docsLink, target: "_blank", rel: "noreferrer" }, "view the documentation"),
|
|
34
|
+
"."),
|
|
35
|
+
hasRequiredFields && (react_1.default.createElement("p", { className: styles.text },
|
|
36
|
+
react_1.default.createElement("i", null,
|
|
37
|
+
"Fields marked in ",
|
|
38
|
+
react_1.default.createElement("span", { className: styles.asterisk }, "*"),
|
|
39
|
+
" are required")))));
|
|
40
|
+
};
|
|
41
|
+
exports.DataSourceDescription = DataSourceDescription;
|
|
42
|
+
//# sourceMappingURL=DataSourceDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataSourceDescription.js","sourceRoot":"","sources":["../../../src/components/ConfigEditor/DataSourceDescription.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,sCAAmC;AACnC,oCAAwC;AAQjC,MAAM,qBAAqB,GAAoB,CAAC,EACrD,cAAc,EACd,QAAQ,EACR,iBAAiB,GAAG,IAAI,GACzB,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,IAAA,cAAS,GAAE,CAAC;IAE1B,MAAM,MAAM,GAAG;QACb,SAAS,EAAE,IAAA,SAAG,EAAC;YACb,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;SAC5B,CAAC;QACF,IAAI,EAAE,IAAA,SAAG,kCACJ,KAAK,CAAC,UAAU,CAAC,IAAI,KACxB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAClC,CAAC,EAAE,IAAA,SAAG,EAAC;gBACL,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI;gBAC7B,cAAc,EAAE,WAAW;gBAC3B,SAAS,EAAE;oBACT,cAAc,EAAE,MAAM;iBACvB;aACF,CAAC,IACF;QACF,QAAQ,EAAE,IAAA,SAAG,EAAA;eACF,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI;KACjC;KACF,CAAC;IAEF,OAAO,CACL,uCAAK,SAAS,EAAE,MAAM,CAAC,SAAS;QAC9B,qCAAG,SAAS,EAAE,MAAM,CAAC,IAAI;;YACC,cAAc;;YAEtC,yCAAM;;YACqB,GAAG;YAC9B,qCAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,6BAE/C;gBAEF;QACH,iBAAiB,IAAI,CACpB,qCAAG,SAAS,EAAE,MAAM,CAAC,IAAI;YACvB;;gBACmB,wCAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,QAAU;gCAEzD,CACF,CACL,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,qBAAqB,yBAiDhC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InlineLabel = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const css_1 = require("@emotion/css");
|
|
7
|
+
const ui_1 = require("@grafana/ui");
|
|
8
|
+
const InlineLabel = (_a) => {
|
|
9
|
+
var { children, required = false } = _a, props = tslib_1.__rest(_a, ["children", "required"]);
|
|
10
|
+
const theme = (0, ui_1.useTheme2)();
|
|
11
|
+
const styles = {
|
|
12
|
+
asterisk: (0, css_1.css) `
|
|
13
|
+
color: ${theme.colors.error.main};
|
|
14
|
+
`,
|
|
15
|
+
};
|
|
16
|
+
return (react_1.default.createElement(ui_1.InlineLabel, Object.assign({}, props),
|
|
17
|
+
react_1.default.createElement("span", null,
|
|
18
|
+
children,
|
|
19
|
+
required && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
20
|
+
"\u00A0",
|
|
21
|
+
react_1.default.createElement("span", { className: styles.asterisk }, "*"))))));
|
|
22
|
+
};
|
|
23
|
+
exports.InlineLabel = InlineLabel;
|
|
24
|
+
//# sourceMappingURL=InlineLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineLabel.js","sourceRoot":"","sources":["../../../src/components/ConfigEditor/InlineLabel.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,sCAAmC;AACnC,oCAA4E;AAMrE,MAAM,WAAW,GAAoB,CAAC,EAI5C,EAAE,EAAE;QAJwC,EAC3C,QAAQ,EACR,QAAQ,GAAG,KAAK,OAEjB,EADI,KAAK,sBAHmC,wBAI5C,CADS;IAER,MAAM,KAAK,GAAG,IAAA,cAAS,GAAE,CAAC;IAE1B,MAAM,MAAM,GAAG;QACb,QAAQ,EAAE,IAAA,SAAG,EAAA;eACF,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI;KACjC;KACF,CAAC;IAEF,OAAO,CACL,8BAAC,gBAAmB,oBAAK,KAAK;QAC5B;YACG,QAAQ;YACR,QAAQ,IAAI,CACX;;gBACQ,wCAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,QAAU,CAC/C,CACJ,CACI,CACa,CACvB,CAAC;AACJ,CAAC,CAAC;AAzBW,QAAA,WAAW,eAyBtB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataSourceDescription = exports.InlineLabel = void 0;
|
|
4
|
+
var InlineLabel_1 = require("./InlineLabel");
|
|
5
|
+
Object.defineProperty(exports, "InlineLabel", { enumerable: true, get: function () { return InlineLabel_1.InlineLabel; } });
|
|
6
|
+
var DataSourceDescription_1 = require("./DataSourceDescription");
|
|
7
|
+
Object.defineProperty(exports, "DataSourceDescription", { enumerable: true, get: function () { return DataSourceDescription_1.DataSourceDescription; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ConfigEditor/index.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA"}
|
package/dist/components/index.js
CHANGED
|
@@ -22,6 +22,7 @@ var ui_1 = require("@grafana/ui");
|
|
|
22
22
|
Object.defineProperty(exports, "InlineSwitch", { enumerable: true, get: function () { return ui_1.InlineSwitch; } });
|
|
23
23
|
Object.defineProperty(exports, "CertificationKey", { enumerable: true, get: function () { return ui_1.CertificationKey; } });
|
|
24
24
|
tslib_1.__exportStar(require("./QueryEditor"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./ConfigEditor"), exports);
|
|
25
26
|
var CustomHeadersSettings_1 = require("./CustomHeadersSettings/CustomHeadersSettings");
|
|
26
27
|
Object.defineProperty(exports, "CustomHeadersSettings", { enumerable: true, get: function () { return CustomHeadersSettings_1.CustomHeadersSettings; } });
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;;AAAA,iFAAgF;AAAvE,0HAAA,mBAAmB,OAAA;AAC5B,kEAAiE;AAAxD,gHAAA,cAAc,OAAA;AACvB,+DAGuC;AAFrC,8GAAA,aAAa,OAAA;AAGf,6CAG2B;AAFzB,kGAAA,OAAO,OAAA;AAGT,sDAAsE;AAA7D,wGAAA,UAAU,OAAA;AACnB,iFAImD;AAHjD,0HAAA,mBAAmB,OAAA;AAEnB,iHAAA,UAAU,OAAA;AAEZ,8EAAoD;AACpD,sDAA4B;AAC5B,8DAAoC;AACpC,kCAA6D;AAApD,kGAAA,YAAY,OAAA;AAAE,sGAAA,gBAAgB,OAAA;AACvC,wDAA8B;AAC9B,uFAAsF;AAA7E,8HAAA,qBAAqB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;;AAAA,iFAAgF;AAAvE,0HAAA,mBAAmB,OAAA;AAC5B,kEAAiE;AAAxD,gHAAA,cAAc,OAAA;AACvB,+DAGuC;AAFrC,8GAAA,aAAa,OAAA;AAGf,6CAG2B;AAFzB,kGAAA,OAAO,OAAA;AAGT,sDAAsE;AAA7D,wGAAA,UAAU,OAAA;AACnB,iFAImD;AAHjD,0HAAA,mBAAmB,OAAA;AAEnB,iHAAA,UAAU,OAAA;AAEZ,8EAAoD;AACpD,sDAA4B;AAC5B,8DAAoC;AACpC,kCAA6D;AAApD,kGAAA,YAAY,OAAA;AAAE,sGAAA,gBAAgB,OAAA;AACvC,wDAA8B;AAC9B,yDAA+B;AAC/B,uFAAsF;AAA7E,8HAAA,qBAAqB,OAAA"}
|
|
@@ -9,4 +9,5 @@ export * from './DataLinks';
|
|
|
9
9
|
export * from './Cascader/Cascader';
|
|
10
10
|
export { InlineSwitch, CertificationKey } from '@grafana/ui';
|
|
11
11
|
export * from './QueryEditor';
|
|
12
|
+
export * from './ConfigEditor';
|
|
12
13
|
export { CustomHeadersSettings } from './CustomHeadersSettings/CustomHeadersSettings';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"repository": "git@github.com:grafana/plugin-ui.git",
|
|
5
5
|
"author": "Grafana Labs",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"@grafana/data": "^8.4.7",
|
|
17
17
|
"@grafana/experimental": "^0.0.2-canary.39",
|
|
18
18
|
"@grafana/runtime": "^8.4.7",
|
|
19
|
-
"@grafana/toolkit": "^8.4.7",
|
|
20
19
|
"@grafana/tsconfig": "1.2.0-rc1",
|
|
21
20
|
"@grafana/ui": "^8.4.7",
|
|
22
21
|
"@types/chance": "^1.1.0",
|
|
@@ -24,6 +23,7 @@
|
|
|
24
23
|
"@types/react-calendar": "^3.1.2",
|
|
25
24
|
"chance": "^1.1.7",
|
|
26
25
|
"copyfiles": "^2.4.1",
|
|
26
|
+
"lodash": "^4.17.21",
|
|
27
27
|
"memoize-one": "^5.1.1",
|
|
28
28
|
"rc-cascader": "1.0.1",
|
|
29
29
|
"react-awesome-query-builder": "^5.3.1",
|
|
@@ -49,7 +49,9 @@
|
|
|
49
49
|
"@testing-library/jest-dom": "^5.11.6",
|
|
50
50
|
"@testing-library/react": "^11.2.2",
|
|
51
51
|
"@testing-library/user-event": "^12.8.3",
|
|
52
|
+
"@types/lodash": "^4.14.194",
|
|
52
53
|
"@types/react": "17.0.38",
|
|
54
|
+
"@types/semver": "^7.5.0",
|
|
53
55
|
"@types/testing-library__jest-dom": "^5.9.5",
|
|
54
56
|
"babel-loader": "^8.2.2",
|
|
55
57
|
"jest-fetch-mock": "^3.0.3",
|