@perses-dev/table-plugin 0.11.2 → 0.13.0-beta.1
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/__mf/css/async/362.85c2cbf6.css +1 -0
- package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
- package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
- package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
- package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
- package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
- package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
- package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
- package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
- package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
- package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
- package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
- package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
- package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
- package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
- package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
- package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
- package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
- package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
- package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
- package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
- package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
- package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
- package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
- package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
- package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
- package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
- package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
- package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
- package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
- package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
- package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
- package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
- package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
- package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
- package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
- package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
- package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
- package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
- package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
- package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
- package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
- package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
- package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
- package/__mf/js/Table.216368cb.js +7 -0
- package/__mf/js/async/1432.47ca9bc7.js +1 -0
- package/__mf/js/async/1616.29b0085e.js +1 -0
- package/__mf/js/async/2043.0b0ffaef.js +2 -0
- package/__mf/js/async/2082.c0b3db38.js +1 -0
- package/__mf/js/async/2842.cee1ed42.js +1 -0
- package/__mf/js/async/339.db885c93.js +1 -0
- package/__mf/js/async/3613.83b242dc.js +22 -0
- package/__mf/js/async/362.4a21f6da.js +7 -0
- package/__mf/js/async/{550.8bab52fc.js.LICENSE.txt → 362.4a21f6da.js.LICENSE.txt} +19 -1
- package/__mf/js/async/392.eef36bcd.js +2 -0
- package/__mf/js/async/4121.403fdade.js +2 -0
- package/__mf/js/async/4320.5cbfbd1c.js +1 -0
- package/__mf/js/async/5002.fd6ad994.js +1 -0
- package/__mf/js/async/5071.1684b9fd.js +1 -0
- package/__mf/js/async/5587.966d92d2.js +1 -0
- package/__mf/js/async/6274.71776a1d.js +2 -0
- package/__mf/js/async/6811.6a011de7.js +38 -0
- package/__mf/js/async/7177.f0c1cf85.js +1 -0
- package/__mf/js/async/7192.f9d57dbb.js +1 -0
- package/__mf/js/async/7413.a78d135c.js +1 -0
- package/__mf/js/async/7862.de8ef786.js +2 -0
- package/__mf/js/async/7968.545aab42.js +1 -0
- package/__mf/js/async/7978.61f7fc2d.js +1 -0
- package/__mf/js/async/8002.0a3e62a4.js +3 -0
- package/__mf/js/async/8356.7a060c2c.js +1 -0
- package/__mf/js/async/8470.dac32d6a.js +2 -0
- package/__mf/js/async/868.a08b9f5f.js +110 -0
- package/__mf/js/async/{868.9f710584.js.LICENSE.txt → 868.a08b9f5f.js.LICENSE.txt} +1 -1
- package/__mf/js/async/873.bb80627c.js +1 -0
- package/__mf/js/async/9051.2db4f8e5.js +1 -0
- package/__mf/js/async/9235.35b8884a.js +1 -0
- package/__mf/js/async/941.97799379.js +2 -0
- package/__mf/js/async/9546.f3c1cf02.js +2 -0
- package/__mf/js/async/{1117.b21b0ae4.js.LICENSE.txt → 9546.f3c1cf02.js.LICENSE.txt} +1 -1
- package/__mf/js/async/9588.178c0b3f.js +1 -0
- package/__mf/js/async/9701.4ae63d2f.js +1 -0
- package/__mf/js/async/__federation_expose_Table.a4d61f93.js +1 -0
- package/__mf/js/async/lib-router.5fad6e02.js +2 -0
- package/__mf/js/async/{lib-router.2e1dec85.js.LICENSE.txt → lib-router.5fad6e02.js.LICENSE.txt} +3 -3
- package/__mf/js/main.db87300f.js +7 -0
- package/lib/TableExportAction.d.ts +1 -1
- package/lib/TableExportAction.d.ts.map +1 -1
- package/lib/TableExportAction.js +1 -2
- package/lib/TableExportAction.js.map +1 -1
- package/lib/cjs/TableExportAction.js +1 -2
- package/lib/cjs/components/ColumnsEditor/ColumnEditor.js +60 -22
- package/lib/cjs/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js +124 -0
- package/lib/cjs/components/TablePanel.js +243 -21
- package/lib/cjs/models/table-model.js +32 -6
- package/lib/components/ColumnsEditor/ColumnEditor.d.ts.map +1 -1
- package/lib/components/ColumnsEditor/ColumnEditor.js +61 -23
- package/lib/components/ColumnsEditor/ColumnEditor.js.map +1 -1
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.d.ts +13 -0
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.d.ts.map +1 -0
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js +114 -0
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js.map +1 -0
- package/lib/components/EmbeddedPanel.d.ts +1 -1
- package/lib/components/EmbeddedPanel.d.ts.map +1 -1
- package/lib/components/EmbeddedPanel.js.map +1 -1
- package/lib/components/TablePanel.d.ts +1 -1
- package/lib/components/TablePanel.d.ts.map +1 -1
- package/lib/components/TablePanel.js +243 -21
- package/lib/components/TablePanel.js.map +1 -1
- package/lib/components/TableTransformsEditor.d.ts.map +1 -1
- package/lib/components/TableTransformsEditor.js.map +1 -1
- package/lib/models/table-model.d.ts +2 -2
- package/lib/models/table-model.d.ts.map +1 -1
- package/lib/models/table-model.js +32 -6
- package/lib/models/table-model.js.map +1 -1
- package/lib/table-data-utils.d.ts +1 -1
- package/lib/table-data-utils.d.ts.map +1 -1
- package/lib/table-data-utils.js.map +1 -1
- package/lib/test/mock-query-results.d.ts +1 -1
- package/lib/test/mock-query-results.js.map +1 -1
- package/mf-manifest.json +91 -75
- package/mf-stats.json +106 -78
- package/package.json +6 -5
- package/__mf/css/async/3061.d3010b86.css +0 -1
- package/__mf/css/async/5442.d3010b86.css +0 -1
- package/__mf/css/async/7823.d3010b86.css +0 -1
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/Table.e34e0ae1.js +0 -6
- package/__mf/js/async/1103.ffbc2bec.js +0 -1
- package/__mf/js/async/1117.b21b0ae4.js +0 -2
- package/__mf/js/async/1432.acd0ad59.js +0 -1
- package/__mf/js/async/1616.7a74f4ef.js +0 -1
- package/__mf/js/async/2043.fdebf89c.js +0 -2
- package/__mf/js/async/208.2b17c08c.js +0 -3
- package/__mf/js/async/2082.78532c3c.js +0 -1
- package/__mf/js/async/272.3bc7825c.js +0 -1
- package/__mf/js/async/392.49e51fc5.js +0 -2
- package/__mf/js/async/4121.8e97ef88.js +0 -2
- package/__mf/js/async/5002.3189d214.js +0 -1
- package/__mf/js/async/5019.5318688a.js +0 -1
- package/__mf/js/async/5071.91e1c002.js +0 -1
- package/__mf/js/async/54.8b007a26.js +0 -22
- package/__mf/js/async/550.8bab52fc.js +0 -7
- package/__mf/js/async/5587.f5f2b0cc.js +0 -1
- package/__mf/js/async/6274.14683c28.js +0 -2
- package/__mf/js/async/6283.e044c368.js +0 -2
- package/__mf/js/async/6753.032ce611.js +0 -1
- package/__mf/js/async/6811.4e18bc66.js +0 -38
- package/__mf/js/async/7177.356298ae.js +0 -1
- package/__mf/js/async/7192.66c9e3a5.js +0 -1
- package/__mf/js/async/7968.a66bfadb.js +0 -1
- package/__mf/js/async/7978.a19f5a4f.js +0 -1
- package/__mf/js/async/8356.8ae40b6a.js +0 -1
- package/__mf/js/async/8470.1b8b20ff.js +0 -2
- package/__mf/js/async/868.9f710584.js +0 -110
- package/__mf/js/async/873.a7310675.js +0 -1
- package/__mf/js/async/9051.e3054e02.js +0 -1
- package/__mf/js/async/9235.eee50e10.js +0 -1
- package/__mf/js/async/941.333875f4.js +0 -2
- package/__mf/js/async/9588.7b021071.js +0 -1
- package/__mf/js/async/9701.3b068d23.js +0 -1
- package/__mf/js/async/__federation_expose_Table.894a962f.js +0 -1
- package/__mf/js/async/lib-router.2e1dec85.js +0 -2
- package/__mf/js/main.5b8b137b.js +0 -6
- /package/__mf/js/async/{2043.fdebf89c.js.LICENSE.txt → 2043.0b0ffaef.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{54.8b007a26.js.LICENSE.txt → 3613.83b242dc.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.49e51fc5.js.LICENSE.txt → 392.eef36bcd.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4121.8e97ef88.js.LICENSE.txt → 4121.403fdade.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.14683c28.js.LICENSE.txt → 6274.71776a1d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6283.e044c368.js.LICENSE.txt → 7862.de8ef786.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.1b8b20ff.js.LICENSE.txt → 8470.dac32d6a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.333875f4.js.LICENSE.txt → 941.97799379.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Copyright 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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "EmbeddedPanelOptionsEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return EmbeddedPanelOptionsEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
26
|
+
const _merge = /*#__PURE__*/ _interop_require_default(require("lodash/merge"));
|
|
27
|
+
const _react = require("react");
|
|
28
|
+
function _interop_require_default(obj) {
|
|
29
|
+
return obj && obj.__esModule ? obj : {
|
|
30
|
+
default: obj
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function isSpecEmpty(spec) {
|
|
34
|
+
if (spec === undefined || spec === null) return true;
|
|
35
|
+
if (typeof spec !== 'object') return false;
|
|
36
|
+
return Object.keys(spec).length === 0;
|
|
37
|
+
}
|
|
38
|
+
function mergeWithPluginDefaults(plugin, spec) {
|
|
39
|
+
const initial = plugin.createInitialOptions() ?? {};
|
|
40
|
+
return (0, _merge.default)({}, initial, spec ?? {});
|
|
41
|
+
}
|
|
42
|
+
function EmbeddedPanelOptionsEditor({ kind, spec, onChange }) {
|
|
43
|
+
const { data: plugin, isLoading, isError, error } = (0, _pluginsystem.usePlugin)('Panel', kind);
|
|
44
|
+
const panelPlugin = plugin;
|
|
45
|
+
const mergedSpec = (0, _react.useMemo)(()=>{
|
|
46
|
+
if (!panelPlugin) {
|
|
47
|
+
return spec;
|
|
48
|
+
}
|
|
49
|
+
return mergeWithPluginDefaults(panelPlugin, spec);
|
|
50
|
+
}, [
|
|
51
|
+
panelPlugin,
|
|
52
|
+
spec
|
|
53
|
+
]);
|
|
54
|
+
const onChangeRef = (0, _react.useRef)(onChange);
|
|
55
|
+
onChangeRef.current = onChange;
|
|
56
|
+
// Persist plugin defaults when the column still has an empty spec (e.g. after switching panel kind).
|
|
57
|
+
(0, _react.useEffect)(()=>{
|
|
58
|
+
if (!panelPlugin || !isSpecEmpty(spec)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
onChangeRef.current(mergeWithPluginDefaults(panelPlugin, spec));
|
|
62
|
+
}, [
|
|
63
|
+
panelPlugin,
|
|
64
|
+
kind,
|
|
65
|
+
spec
|
|
66
|
+
]);
|
|
67
|
+
if (isLoading) {
|
|
68
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
69
|
+
direction: "row",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
spacing: 1,
|
|
72
|
+
sx: {
|
|
73
|
+
py: 1
|
|
74
|
+
},
|
|
75
|
+
children: [
|
|
76
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CircularProgress, {
|
|
77
|
+
size: 22
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
80
|
+
variant: "body2",
|
|
81
|
+
color: "text.secondary",
|
|
82
|
+
children: "Loading panel settings…"
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (isError || !plugin) {
|
|
88
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
89
|
+
variant: "body2",
|
|
90
|
+
color: "error",
|
|
91
|
+
children: error?.message ?? 'Could not load panel plugin.'
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const loadedPlugin = plugin;
|
|
95
|
+
const editorTabs = loadedPlugin.panelOptionsEditorComponents ?? [];
|
|
96
|
+
if (editorTabs.length === 0) {
|
|
97
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
98
|
+
variant: "body2",
|
|
99
|
+
color: "text.secondary",
|
|
100
|
+
children: "This visualization has no editable settings."
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
104
|
+
spacing: 2.5,
|
|
105
|
+
sx: {
|
|
106
|
+
width: '100%',
|
|
107
|
+
py: 1
|
|
108
|
+
},
|
|
109
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.OptionsEditorTabs, {
|
|
110
|
+
tabs: editorTabs.map((tab)=>{
|
|
111
|
+
const Content = tab.content;
|
|
112
|
+
return {
|
|
113
|
+
label: tab.label,
|
|
114
|
+
content: /*#__PURE__*/ (0, _jsxruntime.jsx)(Content, {
|
|
115
|
+
value: mergedSpec,
|
|
116
|
+
onChange: (next)=>{
|
|
117
|
+
onChange(next);
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
};
|
|
121
|
+
})
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
}
|
|
@@ -31,19 +31,163 @@ _export(exports, {
|
|
|
31
31
|
const _jsxruntime = require("react/jsx-runtime");
|
|
32
32
|
const _material = require("@mui/material");
|
|
33
33
|
const _components = require("@perses-dev/components");
|
|
34
|
-
const _core = require("@perses-dev/core");
|
|
35
34
|
const _dashboards = require("@perses-dev/dashboards");
|
|
36
35
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
37
36
|
const _react = require("react");
|
|
38
37
|
const _models = require("../models");
|
|
39
38
|
const _tabledatautils = require("../table-data-utils");
|
|
40
39
|
const _EmbeddedPanel = require("./EmbeddedPanel");
|
|
41
|
-
function
|
|
40
|
+
function parseNumericCellValue(value) {
|
|
41
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
if (typeof value === 'string') {
|
|
45
|
+
const parsed = Number(value);
|
|
46
|
+
if (Number.isFinite(parsed)) {
|
|
47
|
+
return parsed;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
function isPanelData(value) {
|
|
53
|
+
if (typeof value !== 'object' || value === null) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
const candidate = value;
|
|
57
|
+
return candidate.definition !== undefined && candidate.data !== undefined;
|
|
58
|
+
}
|
|
59
|
+
function createSyntheticPanelData(value, columnName) {
|
|
60
|
+
const numericValue = parseNumericCellValue(value);
|
|
61
|
+
if (numericValue === undefined) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
const now = Date.now();
|
|
65
|
+
return {
|
|
66
|
+
definition: {
|
|
67
|
+
kind: 'TimeSeriesQuery',
|
|
68
|
+
spec: {
|
|
69
|
+
plugin: {
|
|
70
|
+
kind: 'PrometheusTimeSeriesQuery',
|
|
71
|
+
spec: {
|
|
72
|
+
query: ''
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
data: {
|
|
78
|
+
timeRange: {
|
|
79
|
+
start: new Date(now),
|
|
80
|
+
end: new Date(now)
|
|
81
|
+
},
|
|
82
|
+
stepMs: 1,
|
|
83
|
+
series: [
|
|
84
|
+
{
|
|
85
|
+
name: columnName,
|
|
86
|
+
values: [
|
|
87
|
+
[
|
|
88
|
+
now,
|
|
89
|
+
numericValue
|
|
90
|
+
]
|
|
91
|
+
],
|
|
92
|
+
labels: {}
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function getGaugeNumericValue(value) {
|
|
99
|
+
if (isPanelData(value)) {
|
|
100
|
+
const series = value.data?.series;
|
|
101
|
+
const firstSeries = series?.[0];
|
|
102
|
+
if (!firstSeries?.values?.length) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
const calc = _pluginsystem.CalculationsMap['last-number'];
|
|
106
|
+
if (typeof calc !== 'function') {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
const calculatedValue = calc(firstSeries.values);
|
|
110
|
+
return typeof calculatedValue === 'number' ? calculatedValue : undefined;
|
|
111
|
+
}
|
|
112
|
+
return parseNumericCellValue(value);
|
|
113
|
+
}
|
|
114
|
+
function InlineGaugeCellWithRange({ value, range, fillColor, format }) {
|
|
115
|
+
if (value === undefined) {
|
|
116
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {});
|
|
117
|
+
}
|
|
118
|
+
let percent = 0;
|
|
119
|
+
if (range !== undefined) {
|
|
120
|
+
if (range.max === range.min) {
|
|
121
|
+
percent = 100;
|
|
122
|
+
} else {
|
|
123
|
+
percent = (value - range.min) / (range.max - range.min) * 100;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
percent = Math.max(0, Math.min(100, percent));
|
|
127
|
+
const trackColor = 'rgba(127,127,127,0.20)';
|
|
128
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
129
|
+
sx: {
|
|
130
|
+
display: 'flex',
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
width: '100%',
|
|
133
|
+
gap: 1
|
|
134
|
+
},
|
|
135
|
+
children: [
|
|
136
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
137
|
+
sx: {
|
|
138
|
+
flexGrow: 1,
|
|
139
|
+
borderRadius: 1,
|
|
140
|
+
backgroundColor: trackColor,
|
|
141
|
+
height: 24,
|
|
142
|
+
overflow: 'hidden'
|
|
143
|
+
},
|
|
144
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
145
|
+
sx: {
|
|
146
|
+
width: `${percent}%`,
|
|
147
|
+
height: '100%',
|
|
148
|
+
backgroundColor: fillColor ?? 'success.main',
|
|
149
|
+
borderRadius: 1
|
|
150
|
+
}
|
|
151
|
+
})
|
|
152
|
+
}),
|
|
153
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
154
|
+
variant: "body2",
|
|
155
|
+
sx: {
|
|
156
|
+
minWidth: 52,
|
|
157
|
+
textAlign: 'right'
|
|
158
|
+
},
|
|
159
|
+
children: format ? (0, _components.formatValue)(value, format) : value.toFixed(2)
|
|
160
|
+
})
|
|
161
|
+
]
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function resolveGaugeFillColor(value, globalCellSettings, columnCellSettings) {
|
|
165
|
+
let cellConfig = (0, _models.evaluateConditionalFormatting)(value, globalCellSettings);
|
|
166
|
+
if (columnCellSettings?.length) {
|
|
167
|
+
const columnCellConfig = (0, _models.evaluateConditionalFormatting)(value, columnCellSettings);
|
|
168
|
+
if (columnCellConfig) {
|
|
169
|
+
cellConfig = columnCellConfig;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return cellConfig?.backgroundColor ?? cellConfig?.textColor;
|
|
173
|
+
}
|
|
174
|
+
function generateCellContentConfig(column, gaugeRange, globalCellSettings = []) {
|
|
42
175
|
const plugin = column.plugin;
|
|
43
176
|
if (plugin !== undefined) {
|
|
44
177
|
return {
|
|
45
178
|
cell: (ctx)=>{
|
|
46
|
-
const
|
|
179
|
+
const cellValue = ctx.getValue();
|
|
180
|
+
if (plugin.kind === 'GaugeChart') {
|
|
181
|
+
const gaugeValue = getGaugeNumericValue(cellValue);
|
|
182
|
+
const gaugeFillColor = resolveGaugeFillColor(gaugeValue, globalCellSettings, column.cellSettings);
|
|
183
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(InlineGaugeCellWithRange, {
|
|
184
|
+
value: gaugeValue,
|
|
185
|
+
range: gaugeRange,
|
|
186
|
+
fillColor: gaugeFillColor,
|
|
187
|
+
format: plugin.spec?.format ?? column.format
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
const panelData = isPanelData(cellValue) ? cellValue : createSyntheticPanelData(cellValue, column.name);
|
|
47
191
|
if (!panelData) return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {});
|
|
48
192
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_EmbeddedPanel.EmbeddedPanel, {
|
|
49
193
|
kind: plugin.kind,
|
|
@@ -59,15 +203,17 @@ function generateCellContentConfig(column) {
|
|
|
59
203
|
return {
|
|
60
204
|
cell: (ctx)=>{
|
|
61
205
|
const cellValue = ctx.getValue();
|
|
62
|
-
return typeof cellValue === 'number' && column.format ? (0,
|
|
206
|
+
return typeof cellValue === 'number' && column.format ? (0, _components.formatValue)(cellValue, column.format) : cellValue;
|
|
63
207
|
},
|
|
64
208
|
cellDescription: column.cellDescription ? ()=>`${column.cellDescription}` : undefined
|
|
65
209
|
};
|
|
66
210
|
}
|
|
67
211
|
function ColumnFilterDropdown({ allValues, selectedValues, onFilterChange, theme }) {
|
|
212
|
+
const [searchTerm, setSearchTerm] = (0, _react.useState)('');
|
|
68
213
|
const values = [
|
|
69
214
|
...new Set(allValues)
|
|
70
215
|
].filter((v)=>v !== null).sort();
|
|
216
|
+
const filteredValues = searchTerm ? values.filter((v)=>String(v).toLowerCase().includes(searchTerm.toLowerCase())) : values;
|
|
71
217
|
if (values.length === 0) {
|
|
72
218
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
73
219
|
"data-filter-dropdown": true,
|
|
@@ -101,6 +247,23 @@ function ColumnFilterDropdown({ allValues, selectedValues, onFilterChange, theme
|
|
|
101
247
|
overflowY: 'auto'
|
|
102
248
|
},
|
|
103
249
|
children: [
|
|
250
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
251
|
+
type: "text",
|
|
252
|
+
placeholder: "Search...",
|
|
253
|
+
value: searchTerm,
|
|
254
|
+
onChange: (e)=>setSearchTerm(e.target.value),
|
|
255
|
+
style: {
|
|
256
|
+
width: '100%',
|
|
257
|
+
padding: '6px 8px',
|
|
258
|
+
marginBottom: 8,
|
|
259
|
+
fontSize: 13,
|
|
260
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
261
|
+
borderRadius: 4,
|
|
262
|
+
backgroundColor: theme.palette.background.default,
|
|
263
|
+
color: theme.palette.text.primary,
|
|
264
|
+
boxSizing: 'border-box'
|
|
265
|
+
}
|
|
266
|
+
}),
|
|
104
267
|
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
105
268
|
style: {
|
|
106
269
|
marginBottom: 8,
|
|
@@ -117,7 +280,7 @@ function ColumnFilterDropdown({ allValues, selectedValues, onFilterChange, theme
|
|
|
117
280
|
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
118
281
|
type: "checkbox",
|
|
119
282
|
checked: selectedValues.length === values.length && values.length > 0,
|
|
120
|
-
onChange: (e)=>onFilterChange(e.target.checked ? values : []),
|
|
283
|
+
onChange: (e)=>onFilterChange(e.target.checked ? values.map((v)=>v.original) : []),
|
|
121
284
|
style: {
|
|
122
285
|
marginRight: 8
|
|
123
286
|
}
|
|
@@ -142,7 +305,7 @@ function ColumnFilterDropdown({ allValues, selectedValues, onFilterChange, theme
|
|
|
142
305
|
borderTop: `1px solid ${theme.palette.divider}`
|
|
143
306
|
}
|
|
144
307
|
}),
|
|
145
|
-
|
|
308
|
+
filteredValues.map((value, index)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
146
309
|
style: {
|
|
147
310
|
marginBottom: 4
|
|
148
311
|
},
|
|
@@ -163,15 +326,15 @@ function ColumnFilterDropdown({ allValues, selectedValues, onFilterChange, theme
|
|
|
163
326
|
children: [
|
|
164
327
|
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
|
|
165
328
|
type: "checkbox",
|
|
166
|
-
checked: selectedValues.includes(value),
|
|
329
|
+
checked: selectedValues.includes(value.original),
|
|
167
330
|
onChange: (e)=>{
|
|
168
331
|
if (e.target.checked) {
|
|
169
332
|
onFilterChange([
|
|
170
333
|
...selectedValues,
|
|
171
|
-
value
|
|
334
|
+
value.original
|
|
172
335
|
]);
|
|
173
336
|
} else {
|
|
174
|
-
onFilterChange(selectedValues.filter((v)=>v !== value));
|
|
337
|
+
onFilterChange(selectedValues.filter((v)=>v !== value.original));
|
|
175
338
|
}
|
|
176
339
|
},
|
|
177
340
|
style: {
|
|
@@ -183,7 +346,7 @@ function ColumnFilterDropdown({ allValues, selectedValues, onFilterChange, theme
|
|
|
183
346
|
fontSize: 14,
|
|
184
347
|
color: theme.palette.text.primary
|
|
185
348
|
},
|
|
186
|
-
children: value === null || value === undefined || value === '' ? '(empty)' : String(value)
|
|
349
|
+
children: value === null || value === undefined || value.formatted === '' ? '(empty)' : String(value.formatted)
|
|
187
350
|
})
|
|
188
351
|
]
|
|
189
352
|
})
|
|
@@ -195,7 +358,7 @@ function ColumnFilterDropdown({ allValues, selectedValues, onFilterChange, theme
|
|
|
195
358
|
* Generate column config from column definitions, if a column has multiple definitions, the first one will be used.
|
|
196
359
|
* If column is hidden, return undefined.
|
|
197
360
|
* If column do not have a definition, return a default column config.
|
|
198
|
-
*/ function generateColumnConfig(name, columnSettings, allVariables) {
|
|
361
|
+
*/ function generateColumnConfig(name, columnSettings, allVariables, gaugeRangeByColumn, globalCellSettings = []) {
|
|
199
362
|
for (const column of columnSettings){
|
|
200
363
|
if (column.name === name) {
|
|
201
364
|
if (column.hide) {
|
|
@@ -214,7 +377,7 @@ function ColumnFilterDropdown({ allValues, selectedValues, onFilterChange, theme
|
|
|
214
377
|
width,
|
|
215
378
|
align,
|
|
216
379
|
dataLink: modifiedDataLink,
|
|
217
|
-
...generateCellContentConfig(column)
|
|
380
|
+
...generateCellContentConfig(column, gaugeRangeByColumn[name], globalCellSettings)
|
|
218
381
|
};
|
|
219
382
|
}
|
|
220
383
|
}
|
|
@@ -282,7 +445,7 @@ function TablePanel({ contentDimensions, spec, queryResults }) {
|
|
|
282
445
|
spec
|
|
283
446
|
]);
|
|
284
447
|
// Transform will be applied by their orders on the original data
|
|
285
|
-
const data = (0, _react.useMemo)(()=>(0,
|
|
448
|
+
const data = (0, _react.useMemo)(()=>(0, _components.transformData)(rawData, spec.transforms ?? []), [
|
|
286
449
|
rawData,
|
|
287
450
|
spec.transforms
|
|
288
451
|
]);
|
|
@@ -299,14 +462,71 @@ function TablePanel({ contentDimensions, spec, queryResults }) {
|
|
|
299
462
|
}, [
|
|
300
463
|
data
|
|
301
464
|
]);
|
|
302
|
-
|
|
465
|
+
const columnsFormat = (0, _react.useMemo)(()=>{
|
|
466
|
+
const columnsFormat = {};
|
|
467
|
+
const settings = spec?.columnSettings;
|
|
468
|
+
if (settings) {
|
|
469
|
+
for(let i = 0; i < settings.length; i++){
|
|
470
|
+
const { name, format } = settings[i] || {};
|
|
471
|
+
if (name && format) {
|
|
472
|
+
columnsFormat[name] = format;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return columnsFormat;
|
|
477
|
+
}, [
|
|
478
|
+
spec
|
|
479
|
+
]);
|
|
303
480
|
const columnUniqueValues = (0, _react.useMemo)(()=>{
|
|
304
481
|
const uniqueValues = {};
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
uniqueValues[key] =
|
|
308
|
-
|
|
482
|
+
for (const key of keys){
|
|
483
|
+
const formatOption = columnsFormat?.[key];
|
|
484
|
+
uniqueValues[key] = [];
|
|
485
|
+
const usedValues = new Map();
|
|
486
|
+
for (const row of data){
|
|
487
|
+
const val = row[key];
|
|
488
|
+
if (val === '' || val === null || val === undefined) {
|
|
489
|
+
continue;
|
|
490
|
+
}
|
|
491
|
+
if (usedValues.get(String(val))) {
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
if (typeof val === 'string' || typeof val === 'number') {
|
|
495
|
+
uniqueValues[key].push({
|
|
496
|
+
original: val,
|
|
497
|
+
formatted: formatOption && typeof val === 'number' ? (0, _components.formatValue)(val, formatOption) : val
|
|
498
|
+
});
|
|
499
|
+
usedValues.set(String(val), true);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
309
503
|
return uniqueValues;
|
|
504
|
+
}, [
|
|
505
|
+
data,
|
|
506
|
+
keys,
|
|
507
|
+
columnsFormat
|
|
508
|
+
]);
|
|
509
|
+
const gaugeRangeByColumn = (0, _react.useMemo)(()=>{
|
|
510
|
+
const result = {};
|
|
511
|
+
for (const key of keys){
|
|
512
|
+
let min = Number.POSITIVE_INFINITY;
|
|
513
|
+
let max = Number.NEGATIVE_INFINITY;
|
|
514
|
+
for (const row of data){
|
|
515
|
+
const numericValue = getGaugeNumericValue(row[key]);
|
|
516
|
+
if (numericValue === undefined) {
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
min = Math.min(min, numericValue);
|
|
520
|
+
max = Math.max(max, numericValue);
|
|
521
|
+
}
|
|
522
|
+
if (min !== Number.POSITIVE_INFINITY && max !== Number.NEGATIVE_INFINITY) {
|
|
523
|
+
result[key] = {
|
|
524
|
+
min,
|
|
525
|
+
max
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return result;
|
|
310
530
|
}, [
|
|
311
531
|
data,
|
|
312
532
|
keys
|
|
@@ -318,7 +538,7 @@ function TablePanel({ contentDimensions, spec, queryResults }) {
|
|
|
318
538
|
// Process columnSettings if they exist
|
|
319
539
|
for (const columnSetting of spec.columnSettings ?? []){
|
|
320
540
|
if (customizedColumns.has(columnSetting.name)) continue; // Skip duplicates
|
|
321
|
-
const columnConfig = generateColumnConfig(columnSetting.name, spec.columnSettings ?? [], allVariables);
|
|
541
|
+
const columnConfig = generateColumnConfig(columnSetting.name, spec.columnSettings ?? [], allVariables, gaugeRangeByColumn, spec.cellSettings ?? []);
|
|
322
542
|
if (columnConfig !== undefined) {
|
|
323
543
|
columns.push(columnConfig);
|
|
324
544
|
customizedColumns.add(columnSetting.name);
|
|
@@ -328,7 +548,7 @@ function TablePanel({ contentDimensions, spec, queryResults }) {
|
|
|
328
548
|
if (!spec.defaultColumnHidden) {
|
|
329
549
|
for (const key of keys){
|
|
330
550
|
if (!customizedColumns.has(key)) {
|
|
331
|
-
const columnConfig = generateColumnConfig(key, spec.columnSettings ?? [], allVariables);
|
|
551
|
+
const columnConfig = generateColumnConfig(key, spec.columnSettings ?? [], allVariables, gaugeRangeByColumn, spec.cellSettings ?? []);
|
|
332
552
|
if (columnConfig !== undefined) {
|
|
333
553
|
columns.push(columnConfig);
|
|
334
554
|
}
|
|
@@ -340,7 +560,9 @@ function TablePanel({ contentDimensions, spec, queryResults }) {
|
|
|
340
560
|
keys,
|
|
341
561
|
spec.columnSettings,
|
|
342
562
|
spec.defaultColumnHidden,
|
|
343
|
-
allVariables
|
|
563
|
+
allVariables,
|
|
564
|
+
gaugeRangeByColumn,
|
|
565
|
+
spec.cellSettings
|
|
344
566
|
]);
|
|
345
567
|
// Generate cell settings that will be used by the table to render cells (text color, background color, ...)
|
|
346
568
|
const cellConfigs = (0, _react.useMemo)(()=>{
|
|
@@ -50,6 +50,14 @@ function createInitialTableOptions() {
|
|
|
50
50
|
enableFiltering: true
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
+
function parseRangeBound(rawValue) {
|
|
54
|
+
const trimmed = rawValue.trim();
|
|
55
|
+
if (trimmed === '') {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
const parsed = Number(trimmed);
|
|
59
|
+
return Number.isNaN(parsed) ? undefined : parsed;
|
|
60
|
+
}
|
|
53
61
|
function formatCellDisplay(value, setting, defaultText) {
|
|
54
62
|
const baseText = setting.text || defaultText || String(value);
|
|
55
63
|
const displayText = `${setting.prefix ?? ''}${baseText}${setting.suffix ?? ''}`;
|
|
@@ -153,13 +161,22 @@ function renderConditionEditor(condition, onChange, size = 'small') {
|
|
|
153
161
|
label: 'From',
|
|
154
162
|
placeholder: 'Start of range',
|
|
155
163
|
value: condition.spec?.min ?? '',
|
|
156
|
-
onChange: (e)=>
|
|
164
|
+
onChange: (e)=>{
|
|
165
|
+
const nextMin = parseRangeBound(e.target.value);
|
|
166
|
+
onChange({
|
|
157
167
|
...condition,
|
|
158
168
|
spec: {
|
|
159
169
|
...condition.spec,
|
|
160
|
-
min:
|
|
170
|
+
min: nextMin
|
|
161
171
|
}
|
|
162
|
-
})
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
type: 'number',
|
|
175
|
+
slotProps: {
|
|
176
|
+
htmlInput: {
|
|
177
|
+
step: 'any'
|
|
178
|
+
}
|
|
179
|
+
},
|
|
163
180
|
fullWidth: true,
|
|
164
181
|
size: size
|
|
165
182
|
}),
|
|
@@ -168,13 +185,22 @@ function renderConditionEditor(condition, onChange, size = 'small') {
|
|
|
168
185
|
label: 'To',
|
|
169
186
|
placeholder: 'End of range (inclusive)',
|
|
170
187
|
value: condition.spec?.max ?? '',
|
|
171
|
-
onChange: (e)=>
|
|
188
|
+
onChange: (e)=>{
|
|
189
|
+
const nextMax = parseRangeBound(e.target.value);
|
|
190
|
+
onChange({
|
|
172
191
|
...condition,
|
|
173
192
|
spec: {
|
|
174
193
|
...condition.spec,
|
|
175
|
-
max:
|
|
194
|
+
max: nextMax
|
|
176
195
|
}
|
|
177
|
-
})
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
type: 'number',
|
|
199
|
+
slotProps: {
|
|
200
|
+
htmlInput: {
|
|
201
|
+
step: 'any'
|
|
202
|
+
}
|
|
203
|
+
},
|
|
178
204
|
fullWidth: true,
|
|
179
205
|
size: size
|
|
180
206
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/ColumnsEditor/ColumnEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAA8B,UAAU,
|
|
1
|
+
{"version":3,"file":"ColumnEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/ColumnsEditor/ColumnEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAA8B,UAAU,EAAiC,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAa/C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAU9C,KAAK,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,UAAU,EAAE,eAAe,CAAC;IAC1E,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;CAC5C;AAED,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,EAAE,iBAAiB,GAAG,YAAY,CA8M7F"}
|