@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.
Files changed (216) hide show
  1. package/__mf/js/{Table.73b9cec1.js → Table.cede74c3.js} +3 -3
  2. package/__mf/js/async/1186.76f7a9c4.js +2 -0
  3. package/__mf/js/async/1522.f490bae9.js +22 -0
  4. package/__mf/js/async/1616.e459f6f7.js +1 -0
  5. package/__mf/js/async/2035.e9f08b1d.js +1 -0
  6. package/__mf/js/async/2043.ddbebd72.js +2 -0
  7. package/__mf/js/async/2251.2ab11c45.js +7 -0
  8. package/__mf/js/async/{1589.124ce93d.js.LICENSE.txt → 2251.2ab11c45.js.LICENSE.txt} +41 -1
  9. package/__mf/js/async/2465.b442bc56.js +1 -0
  10. package/__mf/js/async/2650.b874a7cd.js +3 -0
  11. package/__mf/js/async/392.3b464b91.js +2 -0
  12. package/__mf/js/async/3923.7b9985ff.js +1 -0
  13. package/__mf/js/async/4077.dfd731dd.js +1 -0
  14. package/__mf/js/async/4121.ed15fe74.js +2 -0
  15. package/__mf/js/async/4496.487e4f10.js +1 -0
  16. package/__mf/js/async/5002.fc50985b.js +1 -0
  17. package/__mf/js/async/5054.a0d861ae.js +1 -0
  18. package/__mf/js/async/5071.1e325f38.js +1 -0
  19. package/__mf/js/async/5153.8a046a40.js +1 -0
  20. package/__mf/js/async/5587.c9c77660.js +1 -0
  21. package/__mf/js/async/{868.507e984c.js → 5741.ef0c5df4.js} +6 -6
  22. package/__mf/js/async/6274.db89316a.js +2 -0
  23. package/__mf/js/async/7192.7e6af5a2.js +1 -0
  24. package/__mf/js/async/7534.63c81960.js +1 -0
  25. package/__mf/js/async/7862.cbf7b286.js +2 -0
  26. package/__mf/js/async/7968.f91456c8.js +1 -0
  27. package/__mf/js/async/7978.4553ce86.js +1 -0
  28. package/__mf/js/async/8356.d5d8a6a3.js +1 -0
  29. package/__mf/js/async/8470.f35cd609.js +2 -0
  30. package/__mf/js/async/873.fc45c2c6.js +1 -0
  31. package/__mf/js/async/8985.6cc7edf9.js +37 -0
  32. package/__mf/js/async/9148.1ff77cf0.js +1 -0
  33. package/__mf/js/async/9207.ca6ac0b2.js +1 -0
  34. package/__mf/js/async/9235.78a103e9.js +1 -0
  35. package/__mf/js/async/9321.ddbe25a2.js +1 -0
  36. package/__mf/js/async/941.96941f4e.js +2 -0
  37. package/__mf/js/async/9588.039ce076.js +1 -0
  38. package/__mf/js/async/__federation_expose_Table.e7708af8.js +1 -0
  39. package/__mf/js/async/lib-router.e968bcc8.js +2 -0
  40. package/__mf/js/{main.7b15c841.js → main.7815ee7c.js} +2 -2
  41. package/lib/Table.d.ts +3 -3
  42. package/lib/Table.d.ts.map +1 -1
  43. package/lib/Table.js +4 -4
  44. package/lib/Table.js.map +1 -1
  45. package/lib/TableExportAction.d.ts +3 -3
  46. package/lib/TableExportAction.d.ts.map +1 -1
  47. package/lib/TableExportAction.js +6 -6
  48. package/lib/TableExportAction.js.map +1 -1
  49. package/lib/bootstrap.js +2 -2
  50. package/lib/components/CellsEditor/CellsEditor.d.ts +2 -2
  51. package/lib/components/CellsEditor/CellsEditor.d.ts.map +1 -1
  52. package/lib/components/CellsEditor/CellsEditor.js +1 -1
  53. package/lib/components/CellsEditor/CellsEditor.js.map +1 -1
  54. package/lib/components/CellsEditor/index.js +1 -1
  55. package/lib/components/CellsEditor/index.js.map +1 -1
  56. package/lib/components/ColumnsEditor/ColumnEditor.d.ts +5 -4
  57. package/lib/components/ColumnsEditor/ColumnEditor.d.ts.map +1 -1
  58. package/lib/components/ColumnsEditor/ColumnEditor.js +29 -15
  59. package/lib/components/ColumnsEditor/ColumnEditor.js.map +1 -1
  60. package/lib/components/ColumnsEditor/ColumnEditorContainer.d.ts +3 -3
  61. package/lib/components/ColumnsEditor/ColumnEditorContainer.d.ts.map +1 -1
  62. package/lib/components/ColumnsEditor/ColumnEditorContainer.js +11 -10
  63. package/lib/components/ColumnsEditor/ColumnEditorContainer.js.map +1 -1
  64. package/lib/components/ColumnsEditor/ColumnsEditor.d.ts +4 -3
  65. package/lib/components/ColumnsEditor/ColumnsEditor.d.ts.map +1 -1
  66. package/lib/components/ColumnsEditor/ColumnsEditor.js +7 -6
  67. package/lib/components/ColumnsEditor/ColumnsEditor.js.map +1 -1
  68. package/lib/components/ColumnsEditor/DataLinkEditorDialog.d.ts +2 -2
  69. package/lib/components/ColumnsEditor/DataLinkEditorDialog.d.ts.map +1 -1
  70. package/lib/components/ColumnsEditor/DataLinkEditorDialog.js +4 -4
  71. package/lib/components/ColumnsEditor/DataLinkEditorDialog.js.map +1 -1
  72. package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.d.ts +2 -2
  73. package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.d.ts.map +1 -1
  74. package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js +4 -4
  75. package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js.map +1 -1
  76. package/lib/components/ColumnsEditor/index.js +3 -3
  77. package/lib/components/ColumnsEditor/index.js.map +1 -1
  78. package/lib/components/ConditionalPanel.d.ts +3 -3
  79. package/lib/components/ConditionalPanel.d.ts.map +1 -1
  80. package/lib/components/ConditionalPanel.js +7 -7
  81. package/lib/components/ConditionalPanel.js.map +1 -1
  82. package/lib/components/EmbeddedPanel.d.ts +3 -3
  83. package/lib/components/EmbeddedPanel.d.ts.map +1 -1
  84. package/lib/components/EmbeddedPanel.js +4 -4
  85. package/lib/components/EmbeddedPanel.js.map +1 -1
  86. package/lib/components/TableCellsEditor.d.ts +3 -3
  87. package/lib/components/TableCellsEditor.d.ts.map +1 -1
  88. package/lib/components/TableCellsEditor.js +1 -1
  89. package/lib/components/TableCellsEditor.js.map +1 -1
  90. package/lib/components/TableColumnsEditor.d.ts +3 -3
  91. package/lib/components/TableColumnsEditor.d.ts.map +1 -1
  92. package/lib/components/TableColumnsEditor.js +3 -2
  93. package/lib/components/TableColumnsEditor.js.map +1 -1
  94. package/lib/components/TableItemSelectionActionsEditor.d.ts +2 -2
  95. package/lib/components/TableItemSelectionActionsEditor.d.ts.map +1 -1
  96. package/lib/components/TableItemSelectionActionsEditor.js +2 -2
  97. package/lib/components/TableItemSelectionActionsEditor.js.map +1 -1
  98. package/lib/components/TablePanel.d.ts +4 -4
  99. package/lib/components/TablePanel.d.ts.map +1 -1
  100. package/lib/components/TablePanel.js +196 -99
  101. package/lib/components/TablePanel.js.map +1 -1
  102. package/lib/components/TableSettingsEditor.d.ts +2 -2
  103. package/lib/components/TableSettingsEditor.d.ts.map +1 -1
  104. package/lib/components/TableSettingsEditor.js +16 -2
  105. package/lib/components/TableSettingsEditor.js.map +1 -1
  106. package/lib/components/TableTransformsEditor.d.ts +2 -2
  107. package/lib/components/TableTransformsEditor.d.ts.map +1 -1
  108. package/lib/components/TableTransformsEditor.js +2 -2
  109. package/lib/components/TableTransformsEditor.js.map +1 -1
  110. package/lib/components/index.js +9 -9
  111. package/lib/components/index.js.map +1 -1
  112. package/lib/getPluginModule.d.ts +1 -1
  113. package/lib/getPluginModule.d.ts.map +1 -1
  114. package/lib/getPluginModule.js +3 -1
  115. package/lib/getPluginModule.js.map +1 -1
  116. package/lib/index-federation.js +1 -1
  117. package/lib/index.js +4 -4
  118. package/lib/index.js.map +1 -1
  119. package/lib/models/index.js +2 -2
  120. package/lib/models/index.js.map +1 -1
  121. package/lib/models/model.d.ts +1 -1
  122. package/lib/models/model.d.ts.map +1 -1
  123. package/lib/models/model.js.map +1 -1
  124. package/lib/models/table-model.d.ts +4 -3
  125. package/lib/models/table-model.d.ts.map +1 -1
  126. package/lib/models/table-model.js +2 -2
  127. package/lib/models/table-model.js.map +1 -1
  128. package/lib/setup-tests.d.ts +1 -1
  129. package/lib/setup-tests.d.ts.map +1 -1
  130. package/lib/setup-tests.js +8 -2
  131. package/lib/setup-tests.js.map +1 -1
  132. package/lib/table-data-utils.d.ts +3 -3
  133. package/lib/table-data-utils.d.ts.map +1 -1
  134. package/lib/table-data-utils.js.map +1 -1
  135. package/lib/test/mock-query-results.d.ts +1 -1
  136. package/lib/test/mock-query-results.d.ts.map +1 -1
  137. package/lib/test/mock-query-results.js.map +1 -1
  138. package/mf-manifest.json +48 -46
  139. package/mf-stats.json +52 -47
  140. package/package.json +11 -11
  141. package/__mf/js/async/1432.4e515509.js +0 -1
  142. package/__mf/js/async/1589.124ce93d.js +0 -2
  143. package/__mf/js/async/1616.4828085d.js +0 -1
  144. package/__mf/js/async/2043.1f09864b.js +0 -2
  145. package/__mf/js/async/2082.231e8397.js +0 -1
  146. package/__mf/js/async/2842.a52597e6.js +0 -1
  147. package/__mf/js/async/392.b6035b41.js +0 -2
  148. package/__mf/js/async/3981.52e94742.js +0 -3
  149. package/__mf/js/async/4014.cf88a118.js +0 -7
  150. package/__mf/js/async/4014.cf88a118.js.LICENSE.txt +0 -39
  151. package/__mf/js/async/4121.e7df36d6.js +0 -2
  152. package/__mf/js/async/5002.3eb39a8c.js +0 -1
  153. package/__mf/js/async/5021.c663603d.js +0 -1
  154. package/__mf/js/async/5071.839a8f1a.js +0 -1
  155. package/__mf/js/async/5481.6496fac9.js +0 -2
  156. package/__mf/js/async/5587.a8a428db.js +0 -1
  157. package/__mf/js/async/6274.8edae86d.js +0 -2
  158. package/__mf/js/async/629.8cff215d.js +0 -1
  159. package/__mf/js/async/6811.9d4b123a.js +0 -38
  160. package/__mf/js/async/7177.e0e5ba2f.js +0 -1
  161. package/__mf/js/async/7192.692181c8.js +0 -1
  162. package/__mf/js/async/7413.c9310b8a.js +0 -1
  163. package/__mf/js/async/7968.3a9a982e.js +0 -1
  164. package/__mf/js/async/7978.116e4d81.js +0 -1
  165. package/__mf/js/async/7984.a8edc213.js +0 -22
  166. package/__mf/js/async/8356.152d5686.js +0 -1
  167. package/__mf/js/async/8470.b9762117.js +0 -2
  168. package/__mf/js/async/873.264fedc9.js +0 -1
  169. package/__mf/js/async/9051.c4deebd7.js +0 -1
  170. package/__mf/js/async/9235.c67cdb1d.js +0 -1
  171. package/__mf/js/async/941.cc458a98.js +0 -2
  172. package/__mf/js/async/9588.d23e2ed3.js +0 -1
  173. package/__mf/js/async/9701.9c4cea02.js +0 -1
  174. package/__mf/js/async/__federation_expose_Table.5d0cfb46.js +0 -1
  175. package/__mf/js/async/lib-router.3493bbf9.js +0 -2
  176. package/lib/cjs/Table.js +0 -62
  177. package/lib/cjs/TableExportAction.js +0 -180
  178. package/lib/cjs/bootstrap.js +0 -26
  179. package/lib/cjs/components/CellsEditor/CellsEditor.js +0 -30
  180. package/lib/cjs/components/CellsEditor/index.js +0 -30
  181. package/lib/cjs/components/ColumnsEditor/ColumnEditor.js +0 -289
  182. package/lib/cjs/components/ColumnsEditor/ColumnEditorContainer.js +0 -152
  183. package/lib/cjs/components/ColumnsEditor/ColumnsEditor.js +0 -108
  184. package/lib/cjs/components/ColumnsEditor/DataLinkEditorDialog.js +0 -139
  185. package/lib/cjs/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js +0 -124
  186. package/lib/cjs/components/ColumnsEditor/index.js +0 -32
  187. package/lib/cjs/components/ConditionalPanel.js +0 -367
  188. package/lib/cjs/components/EmbeddedPanel.js +0 -52
  189. package/lib/cjs/components/TableCellsEditor.js +0 -36
  190. package/lib/cjs/components/TableColumnsEditor.js +0 -36
  191. package/lib/cjs/components/TableItemSelectionActionsEditor.js +0 -44
  192. package/lib/cjs/components/TablePanel.js +0 -845
  193. package/lib/cjs/components/TableSettingsEditor.js +0 -144
  194. package/lib/cjs/components/TableTransformsEditor.js +0 -36
  195. package/lib/cjs/components/index.js +0 -38
  196. package/lib/cjs/env.d.js +0 -14
  197. package/lib/cjs/getPluginModule.js +0 -39
  198. package/lib/cjs/index-federation.js +0 -55
  199. package/lib/cjs/index.js +0 -39
  200. package/lib/cjs/models/index.js +0 -31
  201. package/lib/cjs/models/model.js +0 -16
  202. package/lib/cjs/models/table-model.js +0 -278
  203. package/lib/cjs/setup-tests.js +0 -19
  204. package/lib/cjs/table-data-utils.js +0 -84
  205. package/lib/cjs/test/mock-query-results.js +0 -524
  206. /package/__mf/css/async/{4014.85c2cbf6.css → 2251.85c2cbf6.css} +0 -0
  207. /package/__mf/js/async/{7984.a8edc213.js.LICENSE.txt → 1522.f490bae9.js.LICENSE.txt} +0 -0
  208. /package/__mf/js/async/{2043.1f09864b.js.LICENSE.txt → 2043.ddbebd72.js.LICENSE.txt} +0 -0
  209. /package/__mf/js/async/{392.b6035b41.js.LICENSE.txt → 392.3b464b91.js.LICENSE.txt} +0 -0
  210. /package/__mf/js/async/{4121.e7df36d6.js.LICENSE.txt → 4121.ed15fe74.js.LICENSE.txt} +0 -0
  211. /package/__mf/js/async/{868.507e984c.js.LICENSE.txt → 5741.ef0c5df4.js.LICENSE.txt} +0 -0
  212. /package/__mf/js/async/{6274.8edae86d.js.LICENSE.txt → 6274.db89316a.js.LICENSE.txt} +0 -0
  213. /package/__mf/js/async/{5481.6496fac9.js.LICENSE.txt → 7862.cbf7b286.js.LICENSE.txt} +0 -0
  214. /package/__mf/js/async/{8470.b9762117.js.LICENSE.txt → 8470.f35cd609.js.LICENSE.txt} +0 -0
  215. /package/__mf/js/async/{941.cc458a98.js.LICENSE.txt → 941.96941f4e.js.LICENSE.txt} +0 -0
  216. /package/__mf/js/async/{lib-router.3493bbf9.js.LICENSE.txt → lib-router.e968bcc8.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
- }