@perses-dev/table-plugin 0.13.0 → 0.14.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/js/{Table.73b9cec1.js → Table.646f97de.js} +3 -3
- package/__mf/js/async/11.976870d0.js +7 -0
- package/__mf/js/async/11.976870d0.js.LICENSE.txt +102 -0
- package/__mf/js/async/121.b3a4c6cf.js +2 -0
- package/__mf/js/async/153.fa68a9e4.js +1 -0
- package/__mf/js/async/186.ab1e0cb3.js +2 -0
- package/__mf/js/async/192.942516a2.js +1 -0
- package/__mf/js/async/2.6b27d33f.js +1 -0
- package/__mf/js/async/235.c5bac291.js +1 -0
- package/__mf/js/async/274.f7dabfa6.js +2 -0
- package/__mf/js/async/321.96f362a6.js +1 -0
- package/__mf/js/async/35.ba7c1b06.js +1 -0
- package/__mf/js/async/356.d7fe5d24.js +1 -0
- package/__mf/js/async/392.e853a818.js +2 -0
- package/__mf/js/async/413.d44db4b1.js +1 -0
- package/__mf/js/async/465.8425c17a.js +1 -0
- package/__mf/js/async/470.21434f20.js +2 -0
- package/__mf/js/async/522.d6a7c203.js +22 -0
- package/__mf/js/async/534.aff242e9.js +1 -0
- package/__mf/js/async/54.e77ec040.js +1 -0
- package/__mf/js/async/587.0ff26337.js +1 -0
- package/__mf/js/async/616.4e891cf9.js +1 -0
- package/__mf/js/async/663.b3778d4c.js +1 -0
- package/__mf/js/async/700.ccacc909.js +3 -0
- package/__mf/js/async/{868.507e984c.js → 741.7feaa0ba.js} +6 -6
- package/__mf/js/async/862.4c658639.js +2 -0
- package/__mf/js/async/865.b9eb3de4.js +1 -0
- package/__mf/js/async/923.87e55609.js +1 -0
- package/__mf/js/async/941.08c16cb2.js +2 -0
- package/__mf/js/async/968.b7fe9818.js +1 -0
- package/__mf/js/async/985.6129a36c.js +37 -0
- package/__mf/js/async/__federation_expose_Table.f8d0feb7.js +1 -0
- package/__mf/js/async/lib-router.020a2a16.js +2 -0
- package/__mf/js/{main.7b15c841.js → main.276cd542.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 +42 -84
- package/mf-stats.json +46 -93
- 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/1589.124ce93d.js.LICENSE.txt +0 -37
- package/__mf/js/async/1616.4828085d.js +0 -1
- package/__mf/js/async/2043.1f09864b.js +0 -2
- package/__mf/js/async/2043.1f09864b.js.LICENSE.txt +0 -24
- 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 → 11.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{4121.e7df36d6.js.LICENSE.txt → 121.b3a4c6cf.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.8edae86d.js.LICENSE.txt → 274.f7dabfa6.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.b6035b41.js.LICENSE.txt → 392.e853a818.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.b9762117.js.LICENSE.txt → 470.21434f20.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{7984.a8edc213.js.LICENSE.txt → 522.d6a7c203.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{868.507e984c.js.LICENSE.txt → 741.7feaa0ba.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5481.6496fac9.js.LICENSE.txt → 862.4c658639.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.cc458a98.js.LICENSE.txt → 941.08c16cb2.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.3493bbf9.js.LICENSE.txt → lib-router.020a2a16.js.LICENSE.txt} +0 -0
|
@@ -1,152 +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, "ColumnEditorContainer", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return ColumnEditorContainer;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _material = require("@mui/material");
|
|
25
|
-
const _ChevronRight = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronRight"));
|
|
26
|
-
const _ChevronDown = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronDown"));
|
|
27
|
-
const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
|
|
28
|
-
const _EyeOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/EyeOutline"));
|
|
29
|
-
const _EyeOffOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/EyeOffOutline"));
|
|
30
|
-
const _components = require("@perses-dev/components");
|
|
31
|
-
const _ColumnEditor = require("./ColumnEditor");
|
|
32
|
-
function _interop_require_default(obj) {
|
|
33
|
-
return obj && obj.__esModule ? obj : {
|
|
34
|
-
default: obj
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function ColumnEditorContainer({ column, isCollapsed, onChange, onCollapse, onDelete, onMoveUp, onMoveDown }) {
|
|
38
|
-
function handleHideColumn() {
|
|
39
|
-
onChange({
|
|
40
|
-
...column,
|
|
41
|
-
hide: !column.hide
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.DragAndDropElement, {
|
|
45
|
-
data: column,
|
|
46
|
-
children: [
|
|
47
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
48
|
-
direction: "row",
|
|
49
|
-
alignItems: "center",
|
|
50
|
-
borderBottom: 1,
|
|
51
|
-
borderColor: (theme)=>theme.palette.divider,
|
|
52
|
-
justifyContent: "space-between",
|
|
53
|
-
gap: 4,
|
|
54
|
-
children: [
|
|
55
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
56
|
-
direction: "row",
|
|
57
|
-
gap: 1,
|
|
58
|
-
children: [
|
|
59
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
60
|
-
"data-testid": `column-toggle#${column.name}`,
|
|
61
|
-
size: "small",
|
|
62
|
-
onClick: ()=>onCollapse(!isCollapsed),
|
|
63
|
-
children: isCollapsed ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronRight.default, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronDown.default, {})
|
|
64
|
-
}),
|
|
65
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
|
|
66
|
-
variant: "overline",
|
|
67
|
-
component: "h4",
|
|
68
|
-
sx: {
|
|
69
|
-
textTransform: 'none'
|
|
70
|
-
},
|
|
71
|
-
children: [
|
|
72
|
-
"COLUMN:",
|
|
73
|
-
' ',
|
|
74
|
-
column.header ? /*#__PURE__*/ (0, _jsxruntime.jsxs)("span", {
|
|
75
|
-
children: [
|
|
76
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
|
|
77
|
-
children: column.header
|
|
78
|
-
}),
|
|
79
|
-
" (",
|
|
80
|
-
column.name,
|
|
81
|
-
")"
|
|
82
|
-
]
|
|
83
|
-
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)("strong", {
|
|
84
|
-
children: column.name
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
})
|
|
88
|
-
]
|
|
89
|
-
}),
|
|
90
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
91
|
-
direction: "row",
|
|
92
|
-
gap: 1,
|
|
93
|
-
children: [
|
|
94
|
-
isCollapsed && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
95
|
-
children: [
|
|
96
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tooltip, {
|
|
97
|
-
title: column.hide ? 'Show column' : 'Hide column',
|
|
98
|
-
placement: "top",
|
|
99
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
100
|
-
size: "small",
|
|
101
|
-
sx: {
|
|
102
|
-
marginLeft: 'auto'
|
|
103
|
-
},
|
|
104
|
-
onClick: handleHideColumn,
|
|
105
|
-
children: column.hide ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_EyeOffOutline.default, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_EyeOutline.default, {})
|
|
106
|
-
}, "hide-column")
|
|
107
|
-
}),
|
|
108
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {
|
|
109
|
-
flexItem: true,
|
|
110
|
-
orientation: "vertical",
|
|
111
|
-
variant: "middle"
|
|
112
|
-
})
|
|
113
|
-
]
|
|
114
|
-
}),
|
|
115
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tooltip, {
|
|
116
|
-
title: "Remove column settings",
|
|
117
|
-
placement: "top",
|
|
118
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
119
|
-
size: "small",
|
|
120
|
-
sx: {
|
|
121
|
-
marginLeft: 'auto'
|
|
122
|
-
},
|
|
123
|
-
onClick: onDelete,
|
|
124
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {})
|
|
125
|
-
}, "delete-column-button")
|
|
126
|
-
}),
|
|
127
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tooltip, {
|
|
128
|
-
title: "Reorder column settings",
|
|
129
|
-
placement: "top",
|
|
130
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.DragButton, {
|
|
131
|
-
onMoveUp: onMoveUp,
|
|
132
|
-
onMoveDown: onMoveDown,
|
|
133
|
-
menuSx: {
|
|
134
|
-
'.MuiPaper-root': {
|
|
135
|
-
backgroundColor: (theme)=>theme.palette.background.lighter
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}, "reorder-column-button")
|
|
139
|
-
})
|
|
140
|
-
]
|
|
141
|
-
})
|
|
142
|
-
]
|
|
143
|
-
}),
|
|
144
|
-
!isCollapsed && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
145
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ColumnEditor.ColumnEditor, {
|
|
146
|
-
column: column,
|
|
147
|
-
onChange: onChange
|
|
148
|
-
})
|
|
149
|
-
})
|
|
150
|
-
]
|
|
151
|
-
});
|
|
152
|
-
}
|
|
@@ -1,108 +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, "ColumnsEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return ColumnsEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _material = require("@mui/material");
|
|
25
|
-
const _react = require("react");
|
|
26
|
-
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
27
|
-
const _components = require("@perses-dev/components");
|
|
28
|
-
const _ColumnEditorContainer = require("./ColumnEditorContainer");
|
|
29
|
-
function _interop_require_default(obj) {
|
|
30
|
-
return obj && obj.__esModule ? obj : {
|
|
31
|
-
default: obj
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function ColumnsEditor({ columnSettings, onChange }) {
|
|
35
|
-
const [columnsCollapsed, setColumnsCollapsed] = (0, _react.useState)(columnSettings.map(()=>true));
|
|
36
|
-
function handleColumnChange(index, column) {
|
|
37
|
-
const updatedColumns = [
|
|
38
|
-
...columnSettings
|
|
39
|
-
];
|
|
40
|
-
updatedColumns[index] = column;
|
|
41
|
-
onChange(updatedColumns);
|
|
42
|
-
}
|
|
43
|
-
function handleColumnAdd() {
|
|
44
|
-
const columnName = `column_${Object.keys(columnSettings).length}`;
|
|
45
|
-
const updatedColumns = [
|
|
46
|
-
...columnSettings
|
|
47
|
-
];
|
|
48
|
-
updatedColumns.push({
|
|
49
|
-
name: columnName
|
|
50
|
-
});
|
|
51
|
-
onChange(updatedColumns);
|
|
52
|
-
setColumnsCollapsed((prev)=>{
|
|
53
|
-
prev.push(false);
|
|
54
|
-
return [
|
|
55
|
-
...prev
|
|
56
|
-
];
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function handleColumnDelete(index) {
|
|
60
|
-
const updatedColumns = [
|
|
61
|
-
...columnSettings
|
|
62
|
-
];
|
|
63
|
-
updatedColumns.splice(index, 1);
|
|
64
|
-
onChange(updatedColumns);
|
|
65
|
-
setColumnsCollapsed((prev)=>{
|
|
66
|
-
prev.splice(index, 1);
|
|
67
|
-
return [
|
|
68
|
-
...prev
|
|
69
|
-
];
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
function handleColumnCollapseExpand(index, collapsed) {
|
|
73
|
-
setColumnsCollapsed((prev)=>{
|
|
74
|
-
prev[index] = collapsed;
|
|
75
|
-
return [
|
|
76
|
-
...prev
|
|
77
|
-
];
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
(0, _components.useDragAndDropMonitor)({
|
|
81
|
-
elements: columnSettings,
|
|
82
|
-
accessKey: 'name',
|
|
83
|
-
onChange: onChange
|
|
84
|
-
});
|
|
85
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
86
|
-
spacing: 1,
|
|
87
|
-
children: [
|
|
88
|
-
columnSettings.map((column, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_ColumnEditorContainer.ColumnEditorContainer, {
|
|
89
|
-
column: column,
|
|
90
|
-
isCollapsed: columnsCollapsed[i] ?? true,
|
|
91
|
-
onChange: (updatedColumn)=>handleColumnChange(i, updatedColumn),
|
|
92
|
-
onDelete: ()=>handleColumnDelete(i),
|
|
93
|
-
onCollapse: (collapsed)=>handleColumnCollapseExpand(i, collapsed),
|
|
94
|
-
onMoveUp: ()=>onChange((0, _components.handleMoveUp)(column, columnSettings)),
|
|
95
|
-
onMoveDown: ()=>onChange((0, _components.handleMoveDown)(column, columnSettings))
|
|
96
|
-
}, i)),
|
|
97
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
98
|
-
variant: "contained",
|
|
99
|
-
startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {}),
|
|
100
|
-
sx: {
|
|
101
|
-
marginTop: 1
|
|
102
|
-
},
|
|
103
|
-
onClick: handleColumnAdd,
|
|
104
|
-
children: "Add Column Settings"
|
|
105
|
-
})
|
|
106
|
-
]
|
|
107
|
-
});
|
|
108
|
-
}
|
|
@@ -1,139 +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, "DataLinkEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return DataLinkEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _components = require("@perses-dev/components");
|
|
25
|
-
const _material = require("@mui/material");
|
|
26
|
-
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
27
|
-
const _Minus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Minus"));
|
|
28
|
-
function _interop_require_default(obj) {
|
|
29
|
-
return obj && obj.__esModule ? obj : {
|
|
30
|
-
default: obj
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const DataLinkEditor = (props)=>{
|
|
34
|
-
const { onChange, column, column: { dataLink } } = props;
|
|
35
|
-
if (!dataLink) {
|
|
36
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
37
|
-
sx: {
|
|
38
|
-
width: '100%',
|
|
39
|
-
alignItems: 'center'
|
|
40
|
-
},
|
|
41
|
-
direction: "row",
|
|
42
|
-
children: [
|
|
43
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
44
|
-
flex: 1,
|
|
45
|
-
variant: "subtitle1",
|
|
46
|
-
mb: 2,
|
|
47
|
-
fontStyle: "italic",
|
|
48
|
-
children: "No link defined"
|
|
49
|
-
}),
|
|
50
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
51
|
-
style: {
|
|
52
|
-
width: 'fit-content',
|
|
53
|
-
height: 'fit-content'
|
|
54
|
-
},
|
|
55
|
-
onClick: ()=>onChange({
|
|
56
|
-
...column,
|
|
57
|
-
dataLink: {
|
|
58
|
-
url: '',
|
|
59
|
-
openNewTab: true,
|
|
60
|
-
title: ''
|
|
61
|
-
}
|
|
62
|
-
}),
|
|
63
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {})
|
|
64
|
-
})
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
const { url, openNewTab, title } = dataLink;
|
|
69
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
70
|
-
sx: {
|
|
71
|
-
width: '100%',
|
|
72
|
-
alignItems: 'center'
|
|
73
|
-
},
|
|
74
|
-
direction: "row",
|
|
75
|
-
children: [
|
|
76
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.LinkEditorForm, {
|
|
77
|
-
mode: "inline",
|
|
78
|
-
url: {
|
|
79
|
-
label: 'Url',
|
|
80
|
-
onChange: (url)=>{
|
|
81
|
-
onChange({
|
|
82
|
-
...column,
|
|
83
|
-
dataLink: {
|
|
84
|
-
...dataLink,
|
|
85
|
-
url
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
},
|
|
89
|
-
value: url,
|
|
90
|
-
placeholder: 'URL',
|
|
91
|
-
error: {
|
|
92
|
-
hasError: false,
|
|
93
|
-
helperText: ''
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
name: {
|
|
97
|
-
label: 'Name',
|
|
98
|
-
onChange: (title)=>{
|
|
99
|
-
onChange({
|
|
100
|
-
...column,
|
|
101
|
-
dataLink: {
|
|
102
|
-
...dataLink,
|
|
103
|
-
title
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
},
|
|
107
|
-
value: title ?? '',
|
|
108
|
-
placeholder: 'Name'
|
|
109
|
-
},
|
|
110
|
-
newTabOpen: {
|
|
111
|
-
label: 'Open in new tab',
|
|
112
|
-
onChange: (openNewTab)=>{
|
|
113
|
-
onChange({
|
|
114
|
-
...column,
|
|
115
|
-
dataLink: {
|
|
116
|
-
...dataLink,
|
|
117
|
-
openNewTab
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
},
|
|
121
|
-
value: openNewTab
|
|
122
|
-
}
|
|
123
|
-
}),
|
|
124
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
125
|
-
style: {
|
|
126
|
-
width: 'fit-content',
|
|
127
|
-
height: 'fit-content'
|
|
128
|
-
},
|
|
129
|
-
onClick: ()=>{
|
|
130
|
-
onChange({
|
|
131
|
-
...column,
|
|
132
|
-
dataLink: undefined
|
|
133
|
-
});
|
|
134
|
-
},
|
|
135
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Minus.default, {})
|
|
136
|
-
})
|
|
137
|
-
]
|
|
138
|
-
});
|
|
139
|
-
};
|
|
@@ -1,124 +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, "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
|
-
}
|
|
@@ -1,32 +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("./ColumnEditor"), exports);
|
|
18
|
-
_export_star(require("./ColumnEditorContainer"), exports);
|
|
19
|
-
_export_star(require("./ColumnsEditor"), exports);
|
|
20
|
-
function _export_star(from, to) {
|
|
21
|
-
Object.keys(from).forEach(function(k) {
|
|
22
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
23
|
-
Object.defineProperty(to, k, {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function() {
|
|
26
|
-
return from[k];
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return from;
|
|
32
|
-
}
|