@perses-dev/table-plugin 0.13.0 → 0.14.0-beta.2
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/js/{Table.73b9cec1.js → Table.cede74c3.js} +3 -3
- package/__mf/js/async/1186.76f7a9c4.js +2 -0
- package/__mf/js/async/1522.f490bae9.js +22 -0
- package/__mf/js/async/1616.e459f6f7.js +1 -0
- package/__mf/js/async/2035.e9f08b1d.js +1 -0
- package/__mf/js/async/2043.ddbebd72.js +2 -0
- package/__mf/js/async/2251.2ab11c45.js +7 -0
- package/__mf/js/async/{1589.124ce93d.js.LICENSE.txt → 2251.2ab11c45.js.LICENSE.txt} +41 -1
- package/__mf/js/async/2465.b442bc56.js +1 -0
- package/__mf/js/async/2650.b874a7cd.js +3 -0
- package/__mf/js/async/392.3b464b91.js +2 -0
- package/__mf/js/async/3923.7b9985ff.js +1 -0
- package/__mf/js/async/4077.dfd731dd.js +1 -0
- package/__mf/js/async/4121.ed15fe74.js +2 -0
- package/__mf/js/async/4496.487e4f10.js +1 -0
- package/__mf/js/async/5002.fc50985b.js +1 -0
- package/__mf/js/async/5054.a0d861ae.js +1 -0
- package/__mf/js/async/5071.1e325f38.js +1 -0
- package/__mf/js/async/5153.8a046a40.js +1 -0
- package/__mf/js/async/5587.c9c77660.js +1 -0
- package/__mf/js/async/{868.507e984c.js → 5741.ef0c5df4.js} +6 -6
- package/__mf/js/async/6274.db89316a.js +2 -0
- package/__mf/js/async/7192.7e6af5a2.js +1 -0
- package/__mf/js/async/7534.63c81960.js +1 -0
- package/__mf/js/async/7862.cbf7b286.js +2 -0
- package/__mf/js/async/7968.f91456c8.js +1 -0
- package/__mf/js/async/7978.4553ce86.js +1 -0
- package/__mf/js/async/8356.d5d8a6a3.js +1 -0
- package/__mf/js/async/8470.f35cd609.js +2 -0
- package/__mf/js/async/873.fc45c2c6.js +1 -0
- package/__mf/js/async/8985.6cc7edf9.js +37 -0
- package/__mf/js/async/9148.1ff77cf0.js +1 -0
- package/__mf/js/async/9207.ca6ac0b2.js +1 -0
- package/__mf/js/async/9235.78a103e9.js +1 -0
- package/__mf/js/async/9321.ddbe25a2.js +1 -0
- package/__mf/js/async/941.96941f4e.js +2 -0
- package/__mf/js/async/9588.039ce076.js +1 -0
- package/__mf/js/async/__federation_expose_Table.e7708af8.js +1 -0
- package/__mf/js/async/lib-router.e968bcc8.js +2 -0
- package/__mf/js/{main.7b15c841.js → main.7815ee7c.js} +2 -2
- package/lib/Table.d.ts +3 -3
- package/lib/Table.d.ts.map +1 -1
- package/lib/Table.js +4 -4
- package/lib/Table.js.map +1 -1
- package/lib/TableExportAction.d.ts +3 -3
- package/lib/TableExportAction.d.ts.map +1 -1
- package/lib/TableExportAction.js +6 -6
- package/lib/TableExportAction.js.map +1 -1
- package/lib/bootstrap.js +2 -2
- package/lib/components/CellsEditor/CellsEditor.d.ts +2 -2
- package/lib/components/CellsEditor/CellsEditor.d.ts.map +1 -1
- package/lib/components/CellsEditor/CellsEditor.js +1 -1
- package/lib/components/CellsEditor/CellsEditor.js.map +1 -1
- package/lib/components/CellsEditor/index.js +1 -1
- package/lib/components/CellsEditor/index.js.map +1 -1
- package/lib/components/ColumnsEditor/ColumnEditor.d.ts +5 -4
- package/lib/components/ColumnsEditor/ColumnEditor.d.ts.map +1 -1
- package/lib/components/ColumnsEditor/ColumnEditor.js +29 -15
- package/lib/components/ColumnsEditor/ColumnEditor.js.map +1 -1
- package/lib/components/ColumnsEditor/ColumnEditorContainer.d.ts +3 -3
- package/lib/components/ColumnsEditor/ColumnEditorContainer.d.ts.map +1 -1
- package/lib/components/ColumnsEditor/ColumnEditorContainer.js +11 -10
- package/lib/components/ColumnsEditor/ColumnEditorContainer.js.map +1 -1
- package/lib/components/ColumnsEditor/ColumnsEditor.d.ts +4 -3
- package/lib/components/ColumnsEditor/ColumnsEditor.d.ts.map +1 -1
- package/lib/components/ColumnsEditor/ColumnsEditor.js +7 -6
- package/lib/components/ColumnsEditor/ColumnsEditor.js.map +1 -1
- package/lib/components/ColumnsEditor/DataLinkEditorDialog.d.ts +2 -2
- package/lib/components/ColumnsEditor/DataLinkEditorDialog.d.ts.map +1 -1
- package/lib/components/ColumnsEditor/DataLinkEditorDialog.js +4 -4
- package/lib/components/ColumnsEditor/DataLinkEditorDialog.js.map +1 -1
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.d.ts +2 -2
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.d.ts.map +1 -1
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js +4 -4
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js.map +1 -1
- package/lib/components/ColumnsEditor/index.js +3 -3
- package/lib/components/ColumnsEditor/index.js.map +1 -1
- package/lib/components/ConditionalPanel.d.ts +3 -3
- package/lib/components/ConditionalPanel.d.ts.map +1 -1
- package/lib/components/ConditionalPanel.js +7 -7
- package/lib/components/ConditionalPanel.js.map +1 -1
- package/lib/components/EmbeddedPanel.d.ts +3 -3
- package/lib/components/EmbeddedPanel.d.ts.map +1 -1
- package/lib/components/EmbeddedPanel.js +4 -4
- package/lib/components/EmbeddedPanel.js.map +1 -1
- package/lib/components/TableCellsEditor.d.ts +3 -3
- package/lib/components/TableCellsEditor.d.ts.map +1 -1
- package/lib/components/TableCellsEditor.js +1 -1
- package/lib/components/TableCellsEditor.js.map +1 -1
- package/lib/components/TableColumnsEditor.d.ts +3 -3
- package/lib/components/TableColumnsEditor.d.ts.map +1 -1
- package/lib/components/TableColumnsEditor.js +3 -2
- package/lib/components/TableColumnsEditor.js.map +1 -1
- package/lib/components/TableItemSelectionActionsEditor.d.ts +2 -2
- package/lib/components/TableItemSelectionActionsEditor.d.ts.map +1 -1
- package/lib/components/TableItemSelectionActionsEditor.js +2 -2
- package/lib/components/TableItemSelectionActionsEditor.js.map +1 -1
- package/lib/components/TablePanel.d.ts +4 -4
- package/lib/components/TablePanel.d.ts.map +1 -1
- package/lib/components/TablePanel.js +196 -99
- package/lib/components/TablePanel.js.map +1 -1
- package/lib/components/TableSettingsEditor.d.ts +2 -2
- package/lib/components/TableSettingsEditor.d.ts.map +1 -1
- package/lib/components/TableSettingsEditor.js +16 -2
- package/lib/components/TableSettingsEditor.js.map +1 -1
- package/lib/components/TableTransformsEditor.d.ts +2 -2
- package/lib/components/TableTransformsEditor.d.ts.map +1 -1
- package/lib/components/TableTransformsEditor.js +2 -2
- package/lib/components/TableTransformsEditor.js.map +1 -1
- package/lib/components/index.js +9 -9
- package/lib/components/index.js.map +1 -1
- package/lib/getPluginModule.d.ts +1 -1
- package/lib/getPluginModule.d.ts.map +1 -1
- package/lib/getPluginModule.js +3 -1
- package/lib/getPluginModule.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/models/index.js +2 -2
- package/lib/models/index.js.map +1 -1
- package/lib/models/model.d.ts +1 -1
- package/lib/models/model.d.ts.map +1 -1
- package/lib/models/model.js.map +1 -1
- package/lib/models/table-model.d.ts +4 -3
- package/lib/models/table-model.d.ts.map +1 -1
- package/lib/models/table-model.js +2 -2
- package/lib/models/table-model.js.map +1 -1
- package/lib/setup-tests.d.ts +1 -1
- package/lib/setup-tests.d.ts.map +1 -1
- package/lib/setup-tests.js +8 -2
- package/lib/setup-tests.js.map +1 -1
- package/lib/table-data-utils.d.ts +3 -3
- 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.d.ts.map +1 -1
- package/lib/test/mock-query-results.js.map +1 -1
- package/mf-manifest.json +48 -46
- package/mf-stats.json +52 -47
- package/package.json +11 -11
- package/__mf/js/async/1432.4e515509.js +0 -1
- package/__mf/js/async/1589.124ce93d.js +0 -2
- package/__mf/js/async/1616.4828085d.js +0 -1
- package/__mf/js/async/2043.1f09864b.js +0 -2
- package/__mf/js/async/2082.231e8397.js +0 -1
- package/__mf/js/async/2842.a52597e6.js +0 -1
- package/__mf/js/async/392.b6035b41.js +0 -2
- package/__mf/js/async/3981.52e94742.js +0 -3
- package/__mf/js/async/4014.cf88a118.js +0 -7
- package/__mf/js/async/4014.cf88a118.js.LICENSE.txt +0 -39
- package/__mf/js/async/4121.e7df36d6.js +0 -2
- package/__mf/js/async/5002.3eb39a8c.js +0 -1
- package/__mf/js/async/5021.c663603d.js +0 -1
- package/__mf/js/async/5071.839a8f1a.js +0 -1
- package/__mf/js/async/5481.6496fac9.js +0 -2
- package/__mf/js/async/5587.a8a428db.js +0 -1
- package/__mf/js/async/6274.8edae86d.js +0 -2
- package/__mf/js/async/629.8cff215d.js +0 -1
- package/__mf/js/async/6811.9d4b123a.js +0 -38
- package/__mf/js/async/7177.e0e5ba2f.js +0 -1
- package/__mf/js/async/7192.692181c8.js +0 -1
- package/__mf/js/async/7413.c9310b8a.js +0 -1
- package/__mf/js/async/7968.3a9a982e.js +0 -1
- package/__mf/js/async/7978.116e4d81.js +0 -1
- package/__mf/js/async/7984.a8edc213.js +0 -22
- package/__mf/js/async/8356.152d5686.js +0 -1
- package/__mf/js/async/8470.b9762117.js +0 -2
- package/__mf/js/async/873.264fedc9.js +0 -1
- package/__mf/js/async/9051.c4deebd7.js +0 -1
- package/__mf/js/async/9235.c67cdb1d.js +0 -1
- package/__mf/js/async/941.cc458a98.js +0 -2
- package/__mf/js/async/9588.d23e2ed3.js +0 -1
- package/__mf/js/async/9701.9c4cea02.js +0 -1
- package/__mf/js/async/__federation_expose_Table.5d0cfb46.js +0 -1
- package/__mf/js/async/lib-router.3493bbf9.js +0 -2
- package/lib/cjs/Table.js +0 -62
- package/lib/cjs/TableExportAction.js +0 -180
- package/lib/cjs/bootstrap.js +0 -26
- package/lib/cjs/components/CellsEditor/CellsEditor.js +0 -30
- package/lib/cjs/components/CellsEditor/index.js +0 -30
- package/lib/cjs/components/ColumnsEditor/ColumnEditor.js +0 -289
- package/lib/cjs/components/ColumnsEditor/ColumnEditorContainer.js +0 -152
- package/lib/cjs/components/ColumnsEditor/ColumnsEditor.js +0 -108
- package/lib/cjs/components/ColumnsEditor/DataLinkEditorDialog.js +0 -139
- package/lib/cjs/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js +0 -124
- package/lib/cjs/components/ColumnsEditor/index.js +0 -32
- package/lib/cjs/components/ConditionalPanel.js +0 -367
- package/lib/cjs/components/EmbeddedPanel.js +0 -52
- package/lib/cjs/components/TableCellsEditor.js +0 -36
- package/lib/cjs/components/TableColumnsEditor.js +0 -36
- package/lib/cjs/components/TableItemSelectionActionsEditor.js +0 -44
- package/lib/cjs/components/TablePanel.js +0 -845
- package/lib/cjs/components/TableSettingsEditor.js +0 -144
- package/lib/cjs/components/TableTransformsEditor.js +0 -36
- package/lib/cjs/components/index.js +0 -38
- package/lib/cjs/env.d.js +0 -14
- package/lib/cjs/getPluginModule.js +0 -39
- package/lib/cjs/index-federation.js +0 -55
- package/lib/cjs/index.js +0 -39
- package/lib/cjs/models/index.js +0 -31
- package/lib/cjs/models/model.js +0 -16
- package/lib/cjs/models/table-model.js +0 -278
- package/lib/cjs/setup-tests.js +0 -19
- package/lib/cjs/table-data-utils.js +0 -84
- package/lib/cjs/test/mock-query-results.js +0 -524
- /package/__mf/css/async/{4014.85c2cbf6.css → 2251.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{7984.a8edc213.js.LICENSE.txt → 1522.f490bae9.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2043.1f09864b.js.LICENSE.txt → 2043.ddbebd72.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.b6035b41.js.LICENSE.txt → 392.3b464b91.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4121.e7df36d6.js.LICENSE.txt → 4121.ed15fe74.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{868.507e984c.js.LICENSE.txt → 5741.ef0c5df4.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.8edae86d.js.LICENSE.txt → 6274.db89316a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5481.6496fac9.js.LICENSE.txt → 7862.cbf7b286.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.b9762117.js.LICENSE.txt → 8470.f35cd609.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.cc458a98.js.LICENSE.txt → 941.96941f4e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.3493bbf9.js.LICENSE.txt → lib-router.e968bcc8.js.LICENSE.txt} +0 -0
|
@@ -1,180 +0,0 @@
|
|
|
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
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get TableExportAction () {
|
|
25
|
-
return TableExportAction;
|
|
26
|
-
},
|
|
27
|
-
get buildTableData () {
|
|
28
|
-
return buildTableData;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
32
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
33
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
34
|
-
const _components = require("@perses-dev/components");
|
|
35
|
-
const _material = require("@mui/material");
|
|
36
|
-
const _Download = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Download"));
|
|
37
|
-
const _tabledatautils = require("./table-data-utils");
|
|
38
|
-
function _interop_require_default(obj) {
|
|
39
|
-
return obj && obj.__esModule ? obj : {
|
|
40
|
-
default: obj
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
44
|
-
if (typeof WeakMap !== "function") return null;
|
|
45
|
-
var cacheBabelInterop = new WeakMap();
|
|
46
|
-
var cacheNodeInterop = new WeakMap();
|
|
47
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
48
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
49
|
-
})(nodeInterop);
|
|
50
|
-
}
|
|
51
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
52
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
53
|
-
return obj;
|
|
54
|
-
}
|
|
55
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
56
|
-
return {
|
|
57
|
-
default: obj
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
61
|
-
if (cache && cache.has(obj)) {
|
|
62
|
-
return cache.get(obj);
|
|
63
|
-
}
|
|
64
|
-
var newObj = {
|
|
65
|
-
__proto__: null
|
|
66
|
-
};
|
|
67
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
68
|
-
for(var key in obj){
|
|
69
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
70
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
71
|
-
if (desc && (desc.get || desc.set)) {
|
|
72
|
-
Object.defineProperty(newObj, key, desc);
|
|
73
|
-
} else {
|
|
74
|
-
newObj[key] = obj[key];
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
newObj.default = obj;
|
|
79
|
-
if (cache) {
|
|
80
|
-
cache.set(obj, newObj);
|
|
81
|
-
}
|
|
82
|
-
return newObj;
|
|
83
|
-
}
|
|
84
|
-
function buildTableData(queryResults, spec) {
|
|
85
|
-
// Use shared utility with forExport=true to get raw scalar values
|
|
86
|
-
const rawData = (0, _tabledatautils.buildRawTableData)(queryResults, spec, {
|
|
87
|
-
forExport: true
|
|
88
|
-
});
|
|
89
|
-
const transformed = (0, _components.transformData)(rawData, spec.transforms ?? []);
|
|
90
|
-
const allKeys = [];
|
|
91
|
-
for (const entry of transformed){
|
|
92
|
-
for (const key of Object.keys(entry)){
|
|
93
|
-
if (!allKeys.includes(key)) allKeys.push(key);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const columnSettings = spec.columnSettings ?? [];
|
|
97
|
-
const columns = [];
|
|
98
|
-
const customized = new Set();
|
|
99
|
-
for (const col of columnSettings){
|
|
100
|
-
if (customized.has(col.name)) continue;
|
|
101
|
-
customized.add(col.name);
|
|
102
|
-
if (col.hide) continue;
|
|
103
|
-
columns.push({
|
|
104
|
-
key: col.name,
|
|
105
|
-
header: col.header ?? col.name
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
if (!spec.defaultColumnHidden) {
|
|
109
|
-
for (const key of allKeys){
|
|
110
|
-
if (!customized.has(key)) {
|
|
111
|
-
columns.push({
|
|
112
|
-
key,
|
|
113
|
-
header: key
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return {
|
|
119
|
-
data: transformed,
|
|
120
|
-
columns
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
const TableExportAction = ({ queryResults, spec, definition })=>{
|
|
124
|
-
const tableData = (0, _react.useMemo)(()=>buildTableData(queryResults, spec), [
|
|
125
|
-
queryResults,
|
|
126
|
-
spec
|
|
127
|
-
]);
|
|
128
|
-
const canExport = tableData.data.length > 0 && tableData.columns.length > 0;
|
|
129
|
-
const handleExport = (0, _react.useCallback)(()=>{
|
|
130
|
-
if (!canExport) return;
|
|
131
|
-
try {
|
|
132
|
-
const title = definition?.spec?.display?.name || 'Table Data';
|
|
133
|
-
const { data, columns } = tableData;
|
|
134
|
-
const headerRow = columns.map((c)=>(0, _pluginsystem.escapeCsvValue)(c.header)).join(',');
|
|
135
|
-
const dataRows = data.map((row)=>columns.map((col)=>(0, _pluginsystem.escapeCsvValue)(row[col.key])).join(','));
|
|
136
|
-
const csvString = [
|
|
137
|
-
headerRow,
|
|
138
|
-
...dataRows
|
|
139
|
-
].join('\n') + '\n';
|
|
140
|
-
const csvBlob = new Blob([
|
|
141
|
-
csvString
|
|
142
|
-
], {
|
|
143
|
-
type: 'text/csv;charset=utf-8'
|
|
144
|
-
});
|
|
145
|
-
const baseFilename = (0, _pluginsystem.sanitizeFilename)(title);
|
|
146
|
-
const filename = `${baseFilename}_data.csv`;
|
|
147
|
-
const url = URL.createObjectURL(csvBlob);
|
|
148
|
-
try {
|
|
149
|
-
const link = document.createElement('a');
|
|
150
|
-
link.href = url;
|
|
151
|
-
link.download = filename;
|
|
152
|
-
document.body.appendChild(link);
|
|
153
|
-
link.click();
|
|
154
|
-
document.body.removeChild(link);
|
|
155
|
-
} finally{
|
|
156
|
-
URL.revokeObjectURL(url);
|
|
157
|
-
}
|
|
158
|
-
} catch (error) {
|
|
159
|
-
console.error('Table CSV export failed:', error);
|
|
160
|
-
}
|
|
161
|
-
}, [
|
|
162
|
-
canExport,
|
|
163
|
-
tableData,
|
|
164
|
-
definition
|
|
165
|
-
]);
|
|
166
|
-
if (!canExport) {
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
170
|
-
description: "Export as CSV",
|
|
171
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
172
|
-
size: "small",
|
|
173
|
-
onClick: handleExport,
|
|
174
|
-
"aria-label": "Export table data as CSV",
|
|
175
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Download.default, {
|
|
176
|
-
fontSize: "inherit"
|
|
177
|
-
})
|
|
178
|
-
})
|
|
179
|
-
});
|
|
180
|
-
};
|
package/lib/cjs/bootstrap.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
18
|
-
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
19
|
-
const _client = /*#__PURE__*/ _interop_require_default(require("react-dom/client"));
|
|
20
|
-
function _interop_require_default(obj) {
|
|
21
|
-
return obj && obj.__esModule ? obj : {
|
|
22
|
-
default: obj
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const root = _client.default.createRoot(document.getElementById('root'));
|
|
26
|
-
root.render(/*#__PURE__*/ (0, _jsxruntime.jsx)(_react.default.StrictMode, {}));
|
|
@@ -1,30 +0,0 @@
|
|
|
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, "CellsEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return CellsEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _ConditionalPanel = require("../ConditionalPanel");
|
|
25
|
-
function CellsEditor({ cellSettings, onChange }) {
|
|
26
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_ConditionalPanel.ConditionalPanel, {
|
|
27
|
-
cellSettings: cellSettings,
|
|
28
|
-
onChange: (updatedCellSettings)=>onChange(updatedCellSettings || [])
|
|
29
|
-
});
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
_export_star(require("./CellsEditor"), exports);
|
|
18
|
-
function _export_star(from, to) {
|
|
19
|
-
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
-
Object.defineProperty(to, k, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function() {
|
|
24
|
-
return from[k];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return from;
|
|
30
|
-
}
|
|
@@ -1,289 +0,0 @@
|
|
|
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, "ColumnEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return ColumnEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _material = require("@mui/material");
|
|
25
|
-
const _react = require("react");
|
|
26
|
-
const _components = require("@perses-dev/components");
|
|
27
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
28
|
-
const _ConditionalPanel = require("../ConditionalPanel");
|
|
29
|
-
const _DataLinkEditorDialog = require("./DataLinkEditorDialog");
|
|
30
|
-
const _EmbeddedPanelOptionsEditor = require("./EmbeddedPanelOptionsEditor");
|
|
31
|
-
const DEFAULT_FORMAT = {
|
|
32
|
-
unit: 'decimal',
|
|
33
|
-
shortValues: true
|
|
34
|
-
};
|
|
35
|
-
function ColumnEditor({ column, onChange, ...others }) {
|
|
36
|
-
const [width, setWidth] = (0, _react.useState)(column.width === undefined || column.width === 'auto' ? 100 : column.width);
|
|
37
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
38
|
-
...others,
|
|
39
|
-
children: [
|
|
40
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.OptionsEditorGrid, {
|
|
41
|
-
children: [
|
|
42
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorColumn, {
|
|
43
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.OptionsEditorGroup, {
|
|
44
|
-
title: "Column",
|
|
45
|
-
children: [
|
|
46
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
47
|
-
label: "Name*",
|
|
48
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
49
|
-
value: column.name,
|
|
50
|
-
onChange: (e)=>onChange({
|
|
51
|
-
...column,
|
|
52
|
-
name: e.target.value
|
|
53
|
-
}),
|
|
54
|
-
required: true
|
|
55
|
-
})
|
|
56
|
-
}),
|
|
57
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
58
|
-
label: "Header",
|
|
59
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
60
|
-
value: column.header ?? '',
|
|
61
|
-
onChange: (e)=>onChange({
|
|
62
|
-
...column,
|
|
63
|
-
header: e.target.value ? e.target.value : undefined
|
|
64
|
-
})
|
|
65
|
-
})
|
|
66
|
-
}),
|
|
67
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
68
|
-
label: "Header Tooltip",
|
|
69
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
70
|
-
value: column.headerDescription ?? '',
|
|
71
|
-
onChange: (e)=>onChange({
|
|
72
|
-
...column,
|
|
73
|
-
headerDescription: e.target.value ? e.target.value : undefined
|
|
74
|
-
})
|
|
75
|
-
})
|
|
76
|
-
}),
|
|
77
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
78
|
-
label: "Cell Tooltip",
|
|
79
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
80
|
-
value: column.cellDescription ?? '',
|
|
81
|
-
onChange: (e)=>onChange({
|
|
82
|
-
...column,
|
|
83
|
-
cellDescription: e.target.value ? e.target.value : undefined
|
|
84
|
-
})
|
|
85
|
-
})
|
|
86
|
-
}),
|
|
87
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
88
|
-
label: "Enable sorting",
|
|
89
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
90
|
-
checked: column.enableSorting ?? false,
|
|
91
|
-
onChange: (e)=>onChange({
|
|
92
|
-
...column,
|
|
93
|
-
enableSorting: e.target.checked
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
}),
|
|
97
|
-
column.enableSorting && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
98
|
-
label: "Default Sort",
|
|
99
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.SortSelectorButtons, {
|
|
100
|
-
size: "medium",
|
|
101
|
-
value: column.sort,
|
|
102
|
-
sx: {
|
|
103
|
-
margin: 0.5
|
|
104
|
-
},
|
|
105
|
-
onChange: (sort)=>onChange({
|
|
106
|
-
...column,
|
|
107
|
-
sort: sort
|
|
108
|
-
})
|
|
109
|
-
})
|
|
110
|
-
})
|
|
111
|
-
]
|
|
112
|
-
})
|
|
113
|
-
}),
|
|
114
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorColumn, {
|
|
115
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.OptionsEditorGroup, {
|
|
116
|
-
title: "Visual",
|
|
117
|
-
children: [
|
|
118
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
119
|
-
label: "Show column",
|
|
120
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
121
|
-
checked: !(column.hide ?? false),
|
|
122
|
-
onChange: (e)=>onChange({
|
|
123
|
-
...column,
|
|
124
|
-
hide: !e.target.checked
|
|
125
|
-
})
|
|
126
|
-
})
|
|
127
|
-
}),
|
|
128
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
129
|
-
label: "Cell display",
|
|
130
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
131
|
-
spacing: 1,
|
|
132
|
-
children: [
|
|
133
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.ButtonGroup, {
|
|
134
|
-
"aria-label": "Cell display",
|
|
135
|
-
size: "small",
|
|
136
|
-
children: [
|
|
137
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
138
|
-
variant: !column.plugin ? 'contained' : 'outlined',
|
|
139
|
-
onClick: ()=>onChange({
|
|
140
|
-
...column,
|
|
141
|
-
plugin: undefined
|
|
142
|
-
}),
|
|
143
|
-
children: "Text"
|
|
144
|
-
}),
|
|
145
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
146
|
-
variant: column.plugin ? 'contained' : 'outlined',
|
|
147
|
-
onClick: ()=>onChange({
|
|
148
|
-
...column,
|
|
149
|
-
plugin: {
|
|
150
|
-
kind: 'GaugeChart',
|
|
151
|
-
spec: {}
|
|
152
|
-
}
|
|
153
|
-
}),
|
|
154
|
-
children: "Visualization"
|
|
155
|
-
})
|
|
156
|
-
]
|
|
157
|
-
}),
|
|
158
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
159
|
-
variant: "caption",
|
|
160
|
-
color: "text.secondary",
|
|
161
|
-
sx: {
|
|
162
|
-
maxWidth: 360
|
|
163
|
-
},
|
|
164
|
-
children: "Visualizations reuse panel settings (thresholds, units, colors). Text mode uses value formatting below."
|
|
165
|
-
})
|
|
166
|
-
]
|
|
167
|
-
})
|
|
168
|
-
}),
|
|
169
|
-
column.plugin ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
170
|
-
label: "Visualization type",
|
|
171
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginKindSelect, {
|
|
172
|
-
pluginTypes: [
|
|
173
|
-
'Panel'
|
|
174
|
-
],
|
|
175
|
-
size: "small",
|
|
176
|
-
value: {
|
|
177
|
-
type: 'Panel',
|
|
178
|
-
kind: column.plugin.kind
|
|
179
|
-
},
|
|
180
|
-
onChange: (event)=>onChange({
|
|
181
|
-
...column,
|
|
182
|
-
plugin: {
|
|
183
|
-
kind: event.kind,
|
|
184
|
-
spec: {}
|
|
185
|
-
}
|
|
186
|
-
})
|
|
187
|
-
})
|
|
188
|
-
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.FormatControls, {
|
|
189
|
-
value: column.format ?? DEFAULT_FORMAT,
|
|
190
|
-
onChange: (newFormat)=>onChange({
|
|
191
|
-
...column,
|
|
192
|
-
format: newFormat
|
|
193
|
-
})
|
|
194
|
-
}),
|
|
195
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
196
|
-
label: "Alignment",
|
|
197
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.AlignSelector, {
|
|
198
|
-
size: "small",
|
|
199
|
-
value: column.align ?? 'left',
|
|
200
|
-
onChange: (align)=>onChange({
|
|
201
|
-
...column,
|
|
202
|
-
align: align
|
|
203
|
-
})
|
|
204
|
-
})
|
|
205
|
-
}),
|
|
206
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
207
|
-
label: "Custom width",
|
|
208
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
209
|
-
checked: column.width !== undefined && column.width !== 'auto',
|
|
210
|
-
onChange: (e)=>onChange({
|
|
211
|
-
...column,
|
|
212
|
-
width: e.target.checked ? width : 'auto'
|
|
213
|
-
})
|
|
214
|
-
})
|
|
215
|
-
}),
|
|
216
|
-
column.width !== undefined && column.width !== 'auto' && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorControl, {
|
|
217
|
-
label: "Width",
|
|
218
|
-
control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
219
|
-
type: "number",
|
|
220
|
-
value: width,
|
|
221
|
-
slotProps: {
|
|
222
|
-
htmlInput: {
|
|
223
|
-
min: 1
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
onChange: (e)=>{
|
|
227
|
-
setWidth(+e.target.value);
|
|
228
|
-
onChange({
|
|
229
|
-
...column,
|
|
230
|
-
width: +e.target.value
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
})
|
|
234
|
-
})
|
|
235
|
-
]
|
|
236
|
-
})
|
|
237
|
-
}),
|
|
238
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorColumn, {
|
|
239
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorGroup, {
|
|
240
|
-
title: "Link",
|
|
241
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DataLinkEditorDialog.DataLinkEditor, {
|
|
242
|
-
column: column,
|
|
243
|
-
onChange: onChange
|
|
244
|
-
})
|
|
245
|
-
})
|
|
246
|
-
})
|
|
247
|
-
]
|
|
248
|
-
}),
|
|
249
|
-
column.plugin?.kind === 'GaugeChart' && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
250
|
-
sx: {
|
|
251
|
-
px: 8,
|
|
252
|
-
mt: 4,
|
|
253
|
-
width: '100%'
|
|
254
|
-
},
|
|
255
|
-
spacing: 2,
|
|
256
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorGroup, {
|
|
257
|
-
title: "Visualization settings",
|
|
258
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_EmbeddedPanelOptionsEditor.EmbeddedPanelOptionsEditor, {
|
|
259
|
-
kind: "GaugeChart",
|
|
260
|
-
spec: column.plugin.spec,
|
|
261
|
-
onChange: (nextSpec)=>onChange({
|
|
262
|
-
...column,
|
|
263
|
-
plugin: {
|
|
264
|
-
kind: 'GaugeChart',
|
|
265
|
-
spec: nextSpec
|
|
266
|
-
}
|
|
267
|
-
})
|
|
268
|
-
})
|
|
269
|
-
})
|
|
270
|
-
}),
|
|
271
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
272
|
-
sx: {
|
|
273
|
-
px: 8,
|
|
274
|
-
mt: column.plugin?.kind === 'GaugeChart' ? 3 : 0
|
|
275
|
-
},
|
|
276
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorGroup, {
|
|
277
|
-
title: "Conditional Cell Format",
|
|
278
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ConditionalPanel.ConditionalPanel, {
|
|
279
|
-
cellSettings: column.cellSettings,
|
|
280
|
-
onChange: (cellSettings)=>onChange({
|
|
281
|
-
...column,
|
|
282
|
-
cellSettings
|
|
283
|
-
})
|
|
284
|
-
})
|
|
285
|
-
})
|
|
286
|
-
})
|
|
287
|
-
]
|
|
288
|
-
});
|
|
289
|
-
}
|