@grafana/plugin-ui 0.1.14 → 0.1.16
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/DatePickerWithInput/DatePickerWithInput.js +6 -2
- package/dist/components/DatePickerWithInput/DatePickerWithInput.js.map +1 -1
- package/dist/components/DatePickerWithInput/style.css +4 -2
- 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 +1 -1
|
@@ -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
|
+
text: (0, css_1.css) `
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
a {
|
|
14
|
+
color: ${theme.colors.primary.text};
|
|
15
|
+
text-decoration: underline;
|
|
16
|
+
:hover {
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`,
|
|
21
|
+
asterisk: (0, css_1.css) `
|
|
22
|
+
color: ${theme.colors.error.main};
|
|
23
|
+
`,
|
|
24
|
+
};
|
|
25
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
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("em", 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;IAC1B,MAAM,MAAM,GAAG;QACb,IAAI,EAAE,IAAA,SAAG,EAAA;;;iBAGI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI;;;;;;KAMrC;QACD,QAAQ,EAAE,IAAA,SAAG,EAAA;eACF,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI;KACjC;KACF,CAAC;IAEF,OAAO,CACL;QACE,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;gCAExD,CACH,CACL,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,qBAAqB,yBA4ChC"}
|
|
@@ -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"}
|
|
@@ -9,10 +9,14 @@ require("./style.css");
|
|
|
9
9
|
const formatDate = (date) => date.toISOString().split('T')[0];
|
|
10
10
|
exports.formatDate = formatDate;
|
|
11
11
|
const DatePickerWithInput = (props) => {
|
|
12
|
-
const { value, onChange } = props, rest = tslib_1.__rest(props, ["value", "onChange"]);
|
|
12
|
+
const { value, onChange, className } = props, rest = tslib_1.__rest(props, ["value", "onChange", "className"]);
|
|
13
13
|
const [open, setOpen] = react_1.default.useState(false);
|
|
14
|
+
let inputClassName = 'grafana-plugin-ui-date-input';
|
|
15
|
+
if (className) {
|
|
16
|
+
inputClassName += ` ${className}`;
|
|
17
|
+
}
|
|
14
18
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
15
|
-
react_1.default.createElement(ui_1.Input, Object.assign({ type: 'date', placeholder: 'Date', value: (0, exports.formatDate)(value || new Date()), onClick: () => setOpen(true), onChange: () => { } }, rest)),
|
|
19
|
+
react_1.default.createElement(ui_1.Input, Object.assign({ type: 'date', placeholder: 'Date', value: (0, exports.formatDate)(value || new Date()), onClick: () => setOpen(true), onChange: () => { }, className: inputClassName }, rest)),
|
|
16
20
|
react_1.default.createElement(DatePicker_1.DatePicker, { isOpen: open, value: value, onChange: (ev) => onChange(ev), onClose: () => setOpen(false) })));
|
|
17
21
|
};
|
|
18
22
|
exports.DatePickerWithInput = DatePickerWithInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerWithInput.js","sourceRoot":"","sources":["../../../src/components/DatePickerWithInput/DatePickerWithInput.tsx"],"names":[],"mappings":";;;;AAAA,oCAAoC;AACpC,0DAA0B;AAC1B,yDAAsD;AAEtD,uBAAqB;AAEd,MAAM,UAAU,GAAG,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAA9D,QAAA,UAAU,cAAoD;AAQpE,MAA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,QAAQ,CAAC,EAAE,CAAC,EACnC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAC7B,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,mBAAmB,uBA4B9B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* hides the native Calendar picker icon given when using type=date */
|
|
2
|
-
input[type='date']::-webkit-inner-spin-button,
|
|
3
|
-
input[type='date']::-webkit-calendar-picker-indicator
|
|
2
|
+
.grafana-plugin-ui-date-input input[type='date']::-webkit-inner-spin-button,
|
|
3
|
+
.grafana-plugin-ui-date-input input[type='date']::-webkit-calendar-picker-indicator,
|
|
4
|
+
input.grafana-plugin-ui-date-input[type='date']::-webkit-inner-spin-button,
|
|
5
|
+
input.grafana-plugin-ui-date-input[type='date']::-webkit-calendar-picker-indicator {
|
|
4
6
|
display: none;
|
|
5
7
|
-webkit-appearance: none;
|
|
6
8
|
}
|
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';
|